diff --git a/Core/Inc/main.h b/Core/Inc/main.h index d52a238..4abdacf 100644 --- a/Core/Inc/main.h +++ b/Core/Inc/main.h @@ -303,21 +303,23 @@ void Error_Handler(void); // STS_M1, WATER LEAKAGE PA1 READ DATA, PA1 #ifdef STS_M1 -#define WATER_DETECT_Pin GPIO_PIN_1 +#define WATER_DETECT_Pin GPIO_PIN_10 #define WATER_DETECT_Port GPIOA #define WATER_DETECT_STATE HAL_GPIO_ReadPin(WATER_DETECT_Port, WATER_DETECT_Pin) #endif #if defined(STS_M1) /* Water leakage MEMS_IF_1, PA1 */ -#define WATER_LEAKAGE_STATUS_Pin GPIO_PIN_1 -#define WATER_LEAKAGE_STATUS_GPIO_Port GPIOA +//#define WATER_LEAKAGE_STATUS_Pin GPIO_PIN_1 +//#define WATER_LEAKAGE_STATUS_GPIO_Port GPIOA /* Water leakageON_OFF, MEMS_IF_1, PB5 */ -#define WATER_LEAKAGE_SWITCH_Pin GPIO_PIN_5 -#define WATER_LEAKAGE_SWITCH_GPIO_Port GPIOB -#define WATER_LEAKAGE_DATA HAL_GPIO_ReadPin(WATER_LEAKAGE_STATUS_GPIO_Port,WATER_LEAKAGE_STATUS_Pin) +//#define WATER_LEAKAGE_SWITCH_Pin GPIO_PIN_5 +//#define WATER_LEAKAGE_SWITCH_GPIO_Port GPIOB +//#define WATER_LEAKAGE_ENABLE HAL_GPIO_WritePin(WATER_LEAKAGE_SWITCH_GPIO_Port, WATER_LEAKAGE_SWITCH_Pin, GPIO_PIN_SET ) +//#define WATER_LEAKAGE_DISABLE HAL_GPIO_WritePin(WATER_LEAKAGE_SWITCH_GPIO_Port, WATER_LEAKAGE_SWITCH_Pin, GPIO_PIN_RESET ) +//#define WATER_LEAKAGE_DATA HAL_GPIO_ReadPin(WATER_LEAKAGE_STATUS_GPIO_Port,WATER_LEAKAGE_STATUS_Pin) #endif diff --git a/Core/Src/gpio.c b/Core/Src/gpio.c index eb308e1..287b9b3 100644 --- a/Core/Src/gpio.c +++ b/Core/Src/gpio.c @@ -76,7 +76,7 @@ void MX_GPIO_Init(void) #else /*Configure GPIO pins : PAPin PAPin */ - GPIO_InitStruct.Pin = BUT1_Pin|BUT2_Pin; + GPIO_InitStruct.Pin = BUT1_Pin; //|BUT2_Pin; GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING; GPIO_InitStruct.Pull = GPIO_PULLUP; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); @@ -173,6 +173,26 @@ void MX_GPIO_Init(void) HAL_GPIO_Init(SOAP_SWITCH_GPIO_Port, &GPIO_InitStruct); #endif + +#if defined(STS_M1) + + HAL_GPIO_WritePin(WATER_DETECT_Port, WATER_DETECT_Pin, GPIO_PIN_RESET); + + /*Configure GPIO pins : PAPin PAPin */ + GPIO_InitStruct.Pin = WATER_DETECT_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; //GPIO_MODE_INPUT; + GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(WATER_DETECT_Port, &GPIO_InitStruct); + + //GPIO_InitStruct.Pin = WATER_LEAKAGE_SWITCH_Pin; + //GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + //GPIO_InitStruct.Pull = GPIO_PULLDOWN; + //GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + //HAL_GPIO_Init(WATER_LEAKAGE_SWITCH_GPIO_Port, &GPIO_InitStruct); + +#endif + /* ============== SOAP LEVEL DETECTION ========================= */ /* EXTI interrupt init*/ @@ -182,8 +202,12 @@ void MX_GPIO_Init(void) HAL_NVIC_SetPriority(EXTI1_IRQn, 0, 0); HAL_NVIC_EnableIRQ(EXTI1_IRQn); - HAL_NVIC_SetPriority(EXTI9_5_IRQn, 0, 0); - HAL_NVIC_EnableIRQ(EXTI9_5_IRQn); + HAL_NVIC_SetPriority(EXTI15_10_IRQn, 0, 0); + HAL_NVIC_EnableIRQ(EXTI15_10_IRQn); + + +// HAL_NVIC_SetPriority(EXTI9_5_IRQn, 0, 0); +// HAL_NVIC_EnableIRQ(EXTI9_5_IRQn); #ifdef STS_O5 HAL_NVIC_SetPriority(HALL1_EXTI_IRQn, 10, 0); diff --git a/Core/Src/main.c b/Core/Src/main.c index 200c2e9..390eb02 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -114,7 +114,8 @@ int main(void) MX_DMA_Init(); MX_LoRaWAN_Init(); } - +//PME_ON; +//WATER_LEAKAGE_ENABLE; /* USER CODE BEGIN 2 */ //MX_USART2_UART_Init(); /* USER CODE END 2 */ diff --git a/Core/Src/stm32wlxx_it.c b/Core/Src/stm32wlxx_it.c index 8aa30e7..a07d0f9 100644 --- a/Core/Src/stm32wlxx_it.c +++ b/Core/Src/stm32wlxx_it.c @@ -243,11 +243,11 @@ void EXTI1_IRQHandler(void) /* USER CODE BEGIN EXTI1_IRQn 0 */ /* USER CODE END EXTI1_IRQn 0 */ -#if defined(STS_M1) - HAL_GPIO_EXTI_IRQHandler(WATER_LEAKAGE_STATUS_Pin); -#else - HAL_GPIO_EXTI_IRQHandler(BUT2_Pin); -#endif +//#if defined(STS_M1) + //HAL_GPIO_EXTI_IRQHandler(WATER_DETECT_Pin); +//#else +// HAL_GPIO_EXTI_IRQHandler(BUT2_Pin); +//#endif /* USER CODE BEGIN EXTI1_IRQn 1 */ /* USER CODE END EXTI1_IRQn 1 */ @@ -403,6 +403,9 @@ void EXTI15_10_IRQHandler(void) #ifdef STS_O5 HAL_GPIO_EXTI_IRQHandler(HALL2_Pin); #endif +#ifdef STS_M1 + HAL_GPIO_EXTI_IRQHandler(WATER_DETECT_Pin); +#endif #if defined(L8)||defined(STS_P2)||defined(STS_R1D)||defined(STS_R5) HAL_GPIO_EXTI_IRQHandler(TOF_INT_EXTI_PIN); #endif diff --git a/LoRaWAN/App/lora_app.c b/LoRaWAN/App/lora_app.c index 4094143..ab22f30 100644 --- a/LoRaWAN/App/lora_app.c +++ b/LoRaWAN/App/lora_app.c @@ -51,7 +51,9 @@ extern volatile uint32_t rfac_timer; extern volatile uint32_t STS_TOFScanPeriod_msec, STS_TxPeriod_sec, STS_HeartBeatTimerPeriod_sec; volatile uint8_t sts_data_buf[LORAWAN_APP_DATA_BUFFER_MAX_SIZE]={0x0}; //volatile LmHandlerAppData_t sts_app_data={ 0, 0, sts_data_buf }; - +#ifdef STS_M1 +extern volatile uint8_t sts_water_leakage_state; +#endif /* USER CODE END EV */ /* Private typedef -----------------------------------------------------------*/ @@ -491,8 +493,8 @@ void LoRaWAN_Init(void) LmHandlerJoin(ActivationType, ForceRejoin); - //UTIL_TIMER_Create(&YunhornSTSHeartBeatTimer, 1000*STS_HeartBeatTimerPeriod_sec, UTIL_TIMER_ONESHOT, OnYunhornSTSHeartBeatTimerEvent, NULL); - //UTIL_TIMER_Start(&YunhornSTSHeartBeatTimer); + UTIL_TIMER_Create(&YunhornSTSHeartBeatTimer, 1000*STS_HeartBeatTimerPeriod_sec, UTIL_TIMER_PERIODIC, OnYunhornSTSHeartBeatTimerEvent, NULL); + UTIL_TIMER_Start(&YunhornSTSHeartBeatTimer); if (EventType == TX_ON_TIMER) { @@ -588,7 +590,24 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) break; #elif defined(STS_M1) - case WATER_LEAKAGE_STATUS_Pin: + case WATER_DETECT_Pin: + sts_water_leakage_state = WATER_DETECT_STATE; + if (0 == sts_water_leakage_state) + { + HAL_Delay(20); + sts_water_leakage_state = WATER_DETECT_STATE; + if (0 == sts_water_leakage_state) + APP_LOG(TS_OFF, VLEVEL_M, "\r\n water leakage state == 0 \r\n"); + } else + { + HAL_Delay(20); + sts_water_leakage_state = WATER_DETECT_STATE; + if (1 == sts_water_leakage_state) + APP_LOG(TS_OFF, VLEVEL_M, "\r\n water leakage state == 1 \r\n"); + } + HAL_Delay(100); + __HAL_GPIO_EXTI_CLEAR_IT(GPIO_Pin); + UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); break; #else diff --git a/STM32CubeIDE/.cproject b/STM32CubeIDE/.cproject index 61e853c..09acde9 100644 --- a/STM32CubeIDE/.cproject +++ b/STM32CubeIDE/.cproject @@ -99,7 +99,11 @@ +<<<<<<< HEAD +======= + +>>>>>>> bea3868ee84dcbb2b198df549fe409adbd643cc1 @@ -214,6 +218,7 @@ + diff --git a/STM32CubeIDE/Release/Application/User/STS/TOF/App/subdir.mk b/STM32CubeIDE/Release/Application/User/STS/TOF/App/subdir.mk index dfe9ec4..5deb382 100644 --- a/STM32CubeIDE/Release/Application/User/STS/TOF/App/subdir.mk +++ b/STM32CubeIDE/Release/Application/User/STS/TOF/App/subdir.mk @@ -4,22 +4,23 @@ ################################################################################ # Add inputs and outputs from these tool invocations to the build variables -C_SRCS += \ -D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/STS/TOF/App/X-WL55_WLE5_53L0X.c \ -D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/STS/TOF/App/app_tof.c \ -D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/STS/TOF/App/app_tof_peoplecount.c \ +C_SRCS += \ +D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/STS/TOF/App/X-WL55_WLE5_53L0X.c \ +D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/STS/TOF/App/app_tof.c \ +D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/STS/TOF/App/app_tof_peoplecount.c \ +/app_tof_peoplecount.c \ D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/STS/TOF/App/app_tof_vl53l0x_range.c -OBJS += \ -./Application/User/STS/TOF/App/X-WL55_WLE5_53L0X.o \ -./Application/User/STS/TOF/App/app_tof.o \ -./Application/User/STS/TOF/App/app_tof_peoplecount.o \ +OBJS += \ +./Application/User/STS/TOF/App/X-WL55_WLE5_53L0X.o \ +./Application/User/STS/TOF/App/app_tof.o \ +./Application/User/STS/TOF/App/app_tof_peoplecount.o \ ./Application/User/STS/TOF/App/app_tof_vl53l0x_range.o -C_DEPS += \ -./Application/User/STS/TOF/App/X-WL55_WLE5_53L0X.d \ -./Application/User/STS/TOF/App/app_tof.d \ -./Application/User/STS/TOF/App/app_tof_peoplecount.d \ +C_DEPS += \ +./Application/User/STS/TOF/App/X-WL55_WLE5_53L0X.d \ +./Application/User/STS/TOF/App/app_tof.d \ +./Application/User/STS/TOF/App/app_tof_peoplecount.d \ ./Application/User/STS/TOF/App/app_tof_vl53l0x_range.d @@ -30,6 +31,9 @@ Application/User/STS/TOF/App/app_tof.o: D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-W arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -DSTS_P2 -DCORE_CM4 -DUSE_HAL_DRIVER -DSTM32WLE5xx -c -I../../Core/Inc -I../../STS/Core/Inc -I../../STS/TOF/App -I../../STS/TOF/Target -I../../STS/TOF/vl53l1x_uld -I../../STS/TOF/vl53l0x -I../../LoRaWAN/App -I../../LoRaWAN/Target -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc/Legacy -I../../../../../../../Utilities/trace/adv_trace -I../../../../../../../Utilities/misc -I../../../../../../../Utilities/sequencer -I../../../../../../../Utilities/timer -I../../../../../../../Utilities/lpm/tiny_lpm -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler/Packages -I../../../../../../../Drivers/CMSIS/Device/ST/STM32WLxx/Include -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Crypto -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac/Region -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Utilities -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver -I../../../../../../../Middlewares/ST/STM32_Cryptographic/include -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/BSP/STM32WLxx_Nucleo -I../../../../../../../Drivers/BSP/Components/vl53l8cx/porting -I../../../../../../../Drivers/BSP/Components/Common -I../../../../../../../Drivers/BSP/53L8A1 -I../../../../../../../Drivers/BSP/Components/vl53l8cx/modules -I../../../../../../../Drivers/BSP/Components/vl53l8cx -Os -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@" Application/User/STS/TOF/App/app_tof_peoplecount.o: D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/STS/TOF/App/app_tof_peoplecount.c Application/User/STS/TOF/App/subdir.mk arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -DSTS_P2 -DCORE_CM4 -DUSE_HAL_DRIVER -DSTM32WLE5xx -c -I../../Core/Inc -I../../STS/Core/Inc -I../../STS/TOF/App -I../../STS/TOF/Target -I../../STS/TOF/vl53l1x_uld -I../../STS/TOF/vl53l0x -I../../LoRaWAN/App -I../../LoRaWAN/Target -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc/Legacy -I../../../../../../../Utilities/trace/adv_trace -I../../../../../../../Utilities/misc -I../../../../../../../Utilities/sequencer -I../../../../../../../Utilities/timer -I../../../../../../../Utilities/lpm/tiny_lpm -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler/Packages -I../../../../../../../Drivers/CMSIS/Device/ST/STM32WLxx/Include -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Crypto -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac/Region -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Utilities -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver -I../../../../../../../Middlewares/ST/STM32_Cryptographic/include -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/BSP/STM32WLxx_Nucleo -I../../../../../../../Drivers/BSP/Components/vl53l8cx/porting -I../../../../../../../Drivers/BSP/Components/Common -I../../../../../../../Drivers/BSP/53L8A1 -I../../../../../../../Drivers/BSP/Components/vl53l8cx/modules -I../../../../../../../Drivers/BSP/Components/vl53l8cx -Os -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@" + arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -DSTS_M1 -DCORE_CM4 -DUSE_HAL_DRIVER -DSTM32WLE5xx -c -I../../Core/Inc -I../../STS/Core/Inc -I../../STS/TOF/App -I../../STS/TOF/Target -I../../STS/TOF/vl53l1x_uld -I../../STS/TOF/vl53l0x -I../../LoRaWAN/App -I../../LoRaWAN/Target -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc/Legacy -I../../../../../../../Utilities/trace/adv_trace -I../../../../../../../Utilities/misc -I../../../../../../../Utilities/sequencer -I../../../../../../../Utilities/timer -I../../../../../../../Utilities/lpm/tiny_lpm -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler/Packages -I../../../../../../../Drivers/CMSIS/Device/ST/STM32WLxx/Include -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Crypto -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac/Region -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Utilities -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver -I../../../../../../../Middlewares/ST/STM32_Cryptographic/include -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/BSP/STM32WLxx_Nucleo -I../../../../../../../Drivers/BSP/Components/vl53l8cx/porting -I../../../../../../../Drivers/BSP/Components/Common -I../../../../../../../Drivers/BSP/53L8A1 -I../../../../../../../Drivers/BSP/Components/vl53l8cx/modules -I../../../../../../../Drivers/BSP/Components/vl53l8cx -Os -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@" +Application/User/STS/TOF/App/app_tof_peoplecount.o: /app_tof_peoplecount.c Application/User/STS/TOF/App/subdir.mk + arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -DSTS_M1 -DCORE_CM4 -DUSE_HAL_DRIVER -DSTM32WLE5xx -c -I../../Core/Inc -I../../STS/Core/Inc -I../../STS/TOF/App -I../../STS/TOF/Target -I../../STS/TOF/vl53l1x_uld -I../../STS/TOF/vl53l0x -I../../LoRaWAN/App -I../../LoRaWAN/Target -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc/Legacy -I../../../../../../../Utilities/trace/adv_trace -I../../../../../../../Utilities/misc -I../../../../../../../Utilities/sequencer -I../../../../../../../Utilities/timer -I../../../../../../../Utilities/lpm/tiny_lpm -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler/Packages -I../../../../../../../Drivers/CMSIS/Device/ST/STM32WLxx/Include -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Crypto -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac/Region -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Utilities -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver -I../../../../../../../Middlewares/ST/STM32_Cryptographic/include -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/BSP/STM32WLxx_Nucleo -I../../../../../../../Drivers/BSP/Components/vl53l8cx/porting -I../../../../../../../Drivers/BSP/Components/Common -I../../../../../../../Drivers/BSP/53L8A1 -I../../../../../../../Drivers/BSP/Components/vl53l8cx/modules -I../../../../../../../Drivers/BSP/Components/vl53l8cx -Os -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@" Application/User/STS/TOF/App/app_tof_vl53l0x_range.o: D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/STS/TOF/App/app_tof_vl53l0x_range.c Application/User/STS/TOF/App/subdir.mk arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -DSTS_P2 -DCORE_CM4 -DUSE_HAL_DRIVER -DSTM32WLE5xx -c -I../../Core/Inc -I../../STS/Core/Inc -I../../STS/TOF/App -I../../STS/TOF/Target -I../../STS/TOF/vl53l1x_uld -I../../STS/TOF/vl53l0x -I../../LoRaWAN/App -I../../LoRaWAN/Target -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc/Legacy -I../../../../../../../Utilities/trace/adv_trace -I../../../../../../../Utilities/misc -I../../../../../../../Utilities/sequencer -I../../../../../../../Utilities/timer -I../../../../../../../Utilities/lpm/tiny_lpm -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler/Packages -I../../../../../../../Drivers/CMSIS/Device/ST/STM32WLxx/Include -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Crypto -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac/Region -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Utilities -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver -I../../../../../../../Middlewares/ST/STM32_Cryptographic/include -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/BSP/STM32WLxx_Nucleo -I../../../../../../../Drivers/BSP/Components/vl53l8cx/porting -I../../../../../../../Drivers/BSP/Components/Common -I../../../../../../../Drivers/BSP/53L8A1 -I../../../../../../../Drivers/BSP/Components/vl53l8cx/modules -I../../../../../../../Drivers/BSP/Components/vl53l8cx -Os -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@" diff --git a/STM32CubeIDE/Release/Application/User/STS/TOF/vl53l1x_uld/subdir.mk b/STM32CubeIDE/Release/Application/User/STS/TOF/vl53l1x_uld/subdir.mk new file mode 100644 index 0000000..acbe69a --- /dev/null +++ b/STM32CubeIDE/Release/Application/User/STS/TOF/vl53l1x_uld/subdir.mk @@ -0,0 +1,9 @@ +################################################################################ +# Automatically-generated file. Do not edit! +# Toolchain: GNU Tools for STM32 (12.3.rel1) +################################################################################ + +# Add inputs and outputs from these tool invocations to the build variables + +# Each subdirectory must supply rules for building sources it contributes + diff --git a/STM32CubeIDE/Release/WLE5CC_NODE_STS_STS_M1_20241101.elf b/STM32CubeIDE/Release/WLE5CC_NODE_STS_STS_M1_20241101.elf new file mode 100644 index 0000000..d06dbc6 Binary files /dev/null and b/STM32CubeIDE/Release/WLE5CC_NODE_STS_STS_M1_20241101.elf differ diff --git a/STM32CubeIDE/Release/makefile b/STM32CubeIDE/Release/makefile index db0fb8f..3f8434f 100644 --- a/STM32CubeIDE/Release/makefile +++ b/STM32CubeIDE/Release/makefile @@ -19,8 +19,8 @@ RM := rm -rf -include Drivers/BSP/53L8A1/subdir.mk -include Application/User/Startup/subdir.mk -include Application/User/STS/TOF/vl53l1x_uld/subdir.mk +-include Application/User/STS/TOF/vl53l0x/subdir.mk -include Application/User/STS/TOF/Target/subdir.mk --include Application/User/STS/TOF/App/subdir.mk -include Application/User/STS/Core/Src/subdir.mk -include Application/User/LoRaWAN/Target/subdir.mk -include Application/User/LoRaWAN/App/subdir.mk @@ -41,10 +41,10 @@ endif -include ../makefile.defs -OPTIONAL_TOOL_DEPS := \ -$(wildcard ../makefile.defs) \ -$(wildcard ../makefile.init) \ -$(wildcard ../makefile.targets) \ +OPTIONAL_TOOL_DEPS := \ +$(wildcard ../makefile.defs) \ +$(wildcard ../makefile.init) \ +$(wildcard ../makefile.targets) \ BUILD_ARTIFACT_NAME := WLE5CC_NODE_STS @@ -53,17 +53,17 @@ BUILD_ARTIFACT_PREFIX := BUILD_ARTIFACT := $(BUILD_ARTIFACT_PREFIX)$(BUILD_ARTIFACT_NAME)$(if $(BUILD_ARTIFACT_EXTENSION),.$(BUILD_ARTIFACT_EXTENSION),) # Add inputs and outputs from these tool invocations to the build variables -EXECUTABLES += \ -WLE5CC_NODE_STS.elf \ +EXECUTABLES += \ +WLE5CC_NODE_STS.elf \ -MAP_FILES += \ -WLE5CC_NODE_STS.map \ +MAP_FILES += \ +WLE5CC_NODE_STS.map \ -SIZE_OUTPUT += \ -default.size.stdout \ +SIZE_OUTPUT += \ +default.size.stdout \ -OBJDUMP_LIST += \ -WLE5CC_NODE_STS.list \ +OBJDUMP_LIST += \ +WLE5CC_NODE_STS.list \ # All Target diff --git a/STM32CubeIDE/Release/sources.mk b/STM32CubeIDE/Release/sources.mk index cfb8dcf..f55dc9b 100644 --- a/STM32CubeIDE/Release/sources.mk +++ b/STM32CubeIDE/Release/sources.mk @@ -21,21 +21,21 @@ S_UPPER_DEPS := C_DEPS := # Every subdirectory with source files must be described here -SUBDIRS := \ -Application/User/Core \ -Application/User/LoRaWAN/App \ -Application/User/LoRaWAN/Target \ -Application/User/STS/Core/Src \ -Application/User/STS/TOF/App \ -Application/User/STS/TOF/Target \ -Application/User/STS/TOF/vl53l1x_uld \ -Application/User/Startup \ -Drivers/BSP/53L8A1 \ -Drivers/BSP/Components \ -Drivers/BSP/STM32WLxx_Nucleo \ -Drivers/CMSIS \ -Drivers/STM32WLxx_HAL_Driver \ -Middlewares/LoRaWAN \ -Middlewares/SubGHz_Phy \ -Utilities \ +SUBDIRS := \ +Application/User/Core \ +Application/User/LoRaWAN/App \ +Application/User/LoRaWAN/Target \ +Application/User/STS/Core/Src \ +Application/User/STS/TOF/Target \ +Application/User/STS/TOF/vl53l0x \ +Application/User/STS/TOF/vl53l1x_uld \ +Application/User/Startup \ +Drivers/BSP/53L8A1 \ +Drivers/BSP/Components \ +Drivers/BSP/STM32WLxx_Nucleo \ +Drivers/CMSIS \ +Drivers/STM32WLxx_HAL_Driver \ +Middlewares/LoRaWAN \ +Middlewares/SubGHz_Phy \ +Utilities \ diff --git a/STS/BIN/WLE5CC_NODE_STS.elf b/STS/BIN/WLE5CC_NODE_STS.elf new file mode 100644 index 0000000..4184ab3 Binary files /dev/null and b/STS/BIN/WLE5CC_NODE_STS.elf differ diff --git a/STS/BIN/WLE5CC_NODE_STS_L8_OK_20241015.elf b/STS/BIN/WLE5CC_NODE_STS_L8_OK_20241015.elf new file mode 100644 index 0000000..abc1f10 Binary files /dev/null and b/STS/BIN/WLE5CC_NODE_STS_L8_OK_20241015.elf differ diff --git a/STS/BIN/WLE5CC_NODE_STS_R1D_JP_20241030.elf b/STS/BIN/WLE5CC_NODE_STS_R1D_JP_20241030.elf new file mode 100644 index 0000000..0491df2 Binary files /dev/null and b/STS/BIN/WLE5CC_NODE_STS_R1D_JP_20241030.elf differ diff --git a/STS/BIN/WLE5CC_NODE_STS_STS_M1_JP_20241031.elf b/STS/BIN/WLE5CC_NODE_STS_STS_M1_JP_20241031.elf new file mode 100644 index 0000000..4184ab3 Binary files /dev/null and b/STS/BIN/WLE5CC_NODE_STS_STS_M1_JP_20241031.elf differ diff --git a/STS/BIN/WLE5CC_NODE_STS_STS_O5_JP_20241031.elf b/STS/BIN/WLE5CC_NODE_STS_STS_O5_JP_20241031.elf new file mode 100644 index 0000000..565b218 Binary files /dev/null and b/STS/BIN/WLE5CC_NODE_STS_STS_O5_JP_20241031.elf differ diff --git a/STS/BIN/WLE5CC_NODE_STS_STS_R4_JP_20241030.elf b/STS/BIN/WLE5CC_NODE_STS_STS_R4_JP_20241030.elf new file mode 100644 index 0000000..86a3d89 Binary files /dev/null and b/STS/BIN/WLE5CC_NODE_STS_STS_R4_JP_20241030.elf differ diff --git a/STS/BIN/WLE5CC_NODE_STS_STS_R5_20241030A.elf b/STS/BIN/WLE5CC_NODE_STS_STS_R5_20241030A.elf new file mode 100644 index 0000000..7f19afb Binary files /dev/null and b/STS/BIN/WLE5CC_NODE_STS_STS_R5_20241030A.elf differ diff --git a/STS/Core/Inc/yunhorn_sts_prd_conf.h b/STS/Core/Inc/yunhorn_sts_prd_conf.h index ad97465..be73bb6 100644 --- a/STS/Core/Inc/yunhorn_sts_prd_conf.h +++ b/STS/Core/Inc/yunhorn_sts_prd_conf.h @@ -192,7 +192,7 @@ #ifdef STS_M1 #define YUNHORN_STS_M1_LORA_APP_DATA_PORT 6U -#define YUNHORN_STS_M1_LORA_APP_HTBT_PORT 6U +#define YUNHORN_STS_M1_LORA_APP_HTBT_PORT 66U #define YUNHORN_STS_PRD_STRING "STS_M1" #define sts_mtmcode1 0U #define sts_mtmcode2 6U diff --git a/STS/Core/Src/yunhorn_sts_process.c b/STS/Core/Src/yunhorn_sts_process.c index e07023a..12c49cd 100644 --- a/STS/Core/Src/yunhorn_sts_process.c +++ b/STS/Core/Src/yunhorn_sts_process.c @@ -316,8 +316,16 @@ void STS_YunhornSTSEventP1_Process(void) /* STS-M1 Water leakage sensor */ #if defined(STS_M1) + APP_LOG(TS_OFF, VLEVEL_M, "\r\n WATER LEAKAGE DETECTION Process \n"); - sts_water_leakage_state = WATER_LEAKAGE_DATA; + LED1_ON; + HAL_Delay(50); + sts_water_leakage_state = WATER_DETECT_STATE; + APP_LOG(TS_OFF, VLEVEL_M, "\r\n DETECTION RESULT =%d \r\n", sts_water_leakage_state); + + HAL_Delay(40); + PME_OFF; + LED1_OFF; #endif } @@ -575,7 +583,10 @@ void STS_R4_sensor_read(sts_r_sensor_data_t *sts_r_sensor_data) #ifdef STS_M1 void STS_M1_sensor_read(sts_r_sensor_data_t *sts_m_sensor_data) { + sts_m_sensor_data->on_off_event = sts_water_leakage_state; + //sts_m_sensor_data->on_off_event = WATER_LEAKAGE_DATA; + APP_LOG(TS_OFF, VLEVEL_M, "\r\n M1 sensor read =%d \r\n", sts_water_leakage_state); sts_m_sensor_data->measure_tech = 0; //weak current detection } #endif @@ -1660,7 +1671,7 @@ void OnRestoreSTSCFGContextProcess(void) #endif -#if defined(STS_R1)||defined(STS_R5)||defined(STS_R4)||defined(STS_R1D)||defined(STS_O5) +#if defined(STS_R1)||defined(STS_R5)||defined(STS_R4)||defined(STS_R1D)||defined(STS_O5)||defined(STS_M1) OnYunhornSTSHeartBeatPeriodicityChanged(sampling_heartbeat_periodicity*1000); #endif }