From 3593d8cbd273ef0bc0e0e0d33b020115b5741887 Mon Sep 17 00:00:00 2001 From: Luca Date: Fri, 14 Nov 2025 09:37:35 -0800 Subject: [PATCH] Working --- Drivers/CMSIS/Device/ST/STM32L4xx/Include/stm32l432xx.h | 6 +++--- SHAL/Src/{STM32L4XX => STM32L4xx}/Core/SHAL_CORE.cpp | 0 .../Src/{STM32L4XX => STM32L4xx}/EXT/SHAL_EXTI_CALLBACK.cpp | 0 .../{STM32L4XX => STM32L4xx}/Peripheral/ADC/SHAL_ADC.cpp | 0 .../{STM32L4XX => STM32L4xx}/Peripheral/GPIO/SHAL_GPIO.cpp | 0 .../{STM32L4XX => STM32L4xx}/Peripheral/I2C/SHAL_I2C.cpp | 0 .../{STM32L4XX => STM32L4xx}/Peripheral/Timer/SHAL_TIM.cpp | 0 .../Peripheral/Timer/SHAL_TIM_CALLBACK.cpp | 0 .../{STM32L4XX => STM32L4xx}/Peripheral/UART/SHAL_UART.cpp | 0 SHAL/Src/{STM32L4XX => STM32L4xx}/System/system_stm32l4xx.c | 0 SHAL/Src/main.cpp | 3 ++- 11 files changed, 5 insertions(+), 4 deletions(-) rename SHAL/Src/{STM32L4XX => STM32L4xx}/Core/SHAL_CORE.cpp (100%) rename SHAL/Src/{STM32L4XX => STM32L4xx}/EXT/SHAL_EXTI_CALLBACK.cpp (100%) rename SHAL/Src/{STM32L4XX => STM32L4xx}/Peripheral/ADC/SHAL_ADC.cpp (100%) rename SHAL/Src/{STM32L4XX => STM32L4xx}/Peripheral/GPIO/SHAL_GPIO.cpp (100%) rename SHAL/Src/{STM32L4XX => STM32L4xx}/Peripheral/I2C/SHAL_I2C.cpp (100%) rename SHAL/Src/{STM32L4XX => STM32L4xx}/Peripheral/Timer/SHAL_TIM.cpp (100%) rename SHAL/Src/{STM32L4XX => STM32L4xx}/Peripheral/Timer/SHAL_TIM_CALLBACK.cpp (100%) rename SHAL/Src/{STM32L4XX => STM32L4xx}/Peripheral/UART/SHAL_UART.cpp (100%) rename SHAL/Src/{STM32L4XX => STM32L4xx}/System/system_stm32l4xx.c (100%) diff --git a/Drivers/CMSIS/Device/ST/STM32L4xx/Include/stm32l432xx.h b/Drivers/CMSIS/Device/ST/STM32L4xx/Include/stm32l432xx.h index 31bb55b..881b764 100644 --- a/Drivers/CMSIS/Device/ST/STM32L4xx/Include/stm32l432xx.h +++ b/Drivers/CMSIS/Device/ST/STM32L4xx/Include/stm32l432xx.h @@ -45,8 +45,8 @@ * @brief Configuration of the Cortex-M4 Processor and Core Peripherals */ #define __CM4_REV 0x0001U /*!< Cortex-M4 revision r0p1 */ -#define __MPU_PRESENT 1U /*!< STM32L4XX provides an MPU */ -#define __NVIC_PRIO_BITS 4U /*!< STM32L4XX uses 4 Bits for the Priority Levels */ +#define __MPU_PRESENT 1U /*!< STM32L4xx provides an MPU */ +#define __NVIC_PRIO_BITS 4U /*!< STM32L4xx uses 4 Bits for the Priority Levels */ #define __Vendor_SysTickConfig 0U /*!< Set to 1 if different SysTick Config is used */ #define __FPU_PRESENT 1U /*!< FPU present */ @@ -59,7 +59,7 @@ */ /** - * @brief STM32L4XX Interrupt Number Definition, according to the selected device + * @brief STM32L4xx Interrupt Number Definition, according to the selected device * in @ref Library_configuration_section */ typedef enum diff --git a/SHAL/Src/STM32L4XX/Core/SHAL_CORE.cpp b/SHAL/Src/STM32L4xx/Core/SHAL_CORE.cpp similarity index 100% rename from SHAL/Src/STM32L4XX/Core/SHAL_CORE.cpp rename to SHAL/Src/STM32L4xx/Core/SHAL_CORE.cpp diff --git a/SHAL/Src/STM32L4XX/EXT/SHAL_EXTI_CALLBACK.cpp b/SHAL/Src/STM32L4xx/EXT/SHAL_EXTI_CALLBACK.cpp similarity index 100% rename from SHAL/Src/STM32L4XX/EXT/SHAL_EXTI_CALLBACK.cpp rename to SHAL/Src/STM32L4xx/EXT/SHAL_EXTI_CALLBACK.cpp diff --git a/SHAL/Src/STM32L4XX/Peripheral/ADC/SHAL_ADC.cpp b/SHAL/Src/STM32L4xx/Peripheral/ADC/SHAL_ADC.cpp similarity index 100% rename from SHAL/Src/STM32L4XX/Peripheral/ADC/SHAL_ADC.cpp rename to SHAL/Src/STM32L4xx/Peripheral/ADC/SHAL_ADC.cpp diff --git a/SHAL/Src/STM32L4XX/Peripheral/GPIO/SHAL_GPIO.cpp b/SHAL/Src/STM32L4xx/Peripheral/GPIO/SHAL_GPIO.cpp similarity index 100% rename from SHAL/Src/STM32L4XX/Peripheral/GPIO/SHAL_GPIO.cpp rename to SHAL/Src/STM32L4xx/Peripheral/GPIO/SHAL_GPIO.cpp diff --git a/SHAL/Src/STM32L4XX/Peripheral/I2C/SHAL_I2C.cpp b/SHAL/Src/STM32L4xx/Peripheral/I2C/SHAL_I2C.cpp similarity index 100% rename from SHAL/Src/STM32L4XX/Peripheral/I2C/SHAL_I2C.cpp rename to SHAL/Src/STM32L4xx/Peripheral/I2C/SHAL_I2C.cpp diff --git a/SHAL/Src/STM32L4XX/Peripheral/Timer/SHAL_TIM.cpp b/SHAL/Src/STM32L4xx/Peripheral/Timer/SHAL_TIM.cpp similarity index 100% rename from SHAL/Src/STM32L4XX/Peripheral/Timer/SHAL_TIM.cpp rename to SHAL/Src/STM32L4xx/Peripheral/Timer/SHAL_TIM.cpp diff --git a/SHAL/Src/STM32L4XX/Peripheral/Timer/SHAL_TIM_CALLBACK.cpp b/SHAL/Src/STM32L4xx/Peripheral/Timer/SHAL_TIM_CALLBACK.cpp similarity index 100% rename from SHAL/Src/STM32L4XX/Peripheral/Timer/SHAL_TIM_CALLBACK.cpp rename to SHAL/Src/STM32L4xx/Peripheral/Timer/SHAL_TIM_CALLBACK.cpp diff --git a/SHAL/Src/STM32L4XX/Peripheral/UART/SHAL_UART.cpp b/SHAL/Src/STM32L4xx/Peripheral/UART/SHAL_UART.cpp similarity index 100% rename from SHAL/Src/STM32L4XX/Peripheral/UART/SHAL_UART.cpp rename to SHAL/Src/STM32L4xx/Peripheral/UART/SHAL_UART.cpp diff --git a/SHAL/Src/STM32L4XX/System/system_stm32l4xx.c b/SHAL/Src/STM32L4xx/System/system_stm32l4xx.c similarity index 100% rename from SHAL/Src/STM32L4XX/System/system_stm32l4xx.c rename to SHAL/Src/STM32L4xx/System/system_stm32l4xx.c diff --git a/SHAL/Src/main.cpp b/SHAL/Src/main.cpp index 1edd5df..04293d5 100644 --- a/SHAL/Src/main.cpp +++ b/SHAL/Src/main.cpp @@ -104,7 +104,7 @@ void calibrateThresholds(){ // Read every channel once and set threshold to 80% of reading for(int i = 0; i < NUM_CHANNELS; i++){ - uint16_t sensorVal = vals[i]; + uint16_t sensorVal = (vals[i] * 3) / 5; if(sensorVal < 50){ sensorVal = 0; @@ -244,6 +244,7 @@ int main() { areSensorRequirementsMetCurrent = true; areSensorRequirementsMetPrevious = true; + SHAL_TIM15.stop(); stopBeeping(); }