diff --git a/Core/Inc/main.h b/Core/Inc/main.h
index f7ade35..4abdacf 100644
--- a/Core/Inc/main.h
+++ b/Core/Inc/main.h
@@ -302,23 +302,24 @@ 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_Port GPIOA
-//#define WATER_DETECT_STATE HAL_GPIO_ReadPin(WATER_DETECT_Port, WATER_DETECT_Pin)
-//#endif
+#ifdef STS_M1
+#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_10
-#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_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)
+
+//#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 9e99f26..287b9b3 100644
--- a/Core/Src/gpio.c
+++ b/Core/Src/gpio.c
@@ -176,20 +176,20 @@ void MX_GPIO_Init(void)
#if defined(STS_M1)
- HAL_GPIO_WritePin(WATER_LEAKAGE_SWITCH_GPIO_Port, WATER_LEAKAGE_SWITCH_Pin, GPIO_PIN_RESET);
+ HAL_GPIO_WritePin(WATER_DETECT_Port, WATER_DETECT_Pin, GPIO_PIN_RESET);
/*Configure GPIO pins : PAPin PAPin */
- GPIO_InitStruct.Pin = WATER_LEAKAGE_STATUS_Pin;
- GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING; //GPIO_MODE_INPUT;
+ 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_LEAKAGE_STATUS_GPIO_Port, &GPIO_InitStruct);
+ 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);
+ //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
diff --git a/Core/Src/stm32wlxx_it.c b/Core/Src/stm32wlxx_it.c
index 3398948..a07d0f9 100644
--- a/Core/Src/stm32wlxx_it.c
+++ b/Core/Src/stm32wlxx_it.c
@@ -244,7 +244,7 @@ void EXTI1_IRQHandler(void)
/* USER CODE END EXTI1_IRQn 0 */
//#if defined(STS_M1)
- //HAL_GPIO_EXTI_IRQHandler(WATER_LEAKAGE_STATUS_Pin);
+ //HAL_GPIO_EXTI_IRQHandler(WATER_DETECT_Pin);
//#else
// HAL_GPIO_EXTI_IRQHandler(BUT2_Pin);
//#endif
@@ -404,7 +404,7 @@ void EXTI15_10_IRQHandler(void)
HAL_GPIO_EXTI_IRQHandler(HALL2_Pin);
#endif
#ifdef STS_M1
- HAL_GPIO_EXTI_IRQHandler(WATER_LEAKAGE_STATUS_Pin);
+ 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);
diff --git a/LoRaWAN/App/lora_app.c b/LoRaWAN/App/lora_app.c
index cc5bc56..e30b13c 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 -----------------------------------------------------------*/
@@ -587,7 +589,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 7992632..1e6f094 100644
--- a/STM32CubeIDE/.cproject
+++ b/STM32CubeIDE/.cproject
@@ -98,6 +98,9 @@
+
+
+
@@ -209,6 +212,9 @@
+
+
+
diff --git a/STM32CubeIDE/Release/Application/User/STS/TOF/App/subdir.mk b/STM32CubeIDE/Release/Application/User/STS/TOF/App/subdir.mk
index 7e9bd51..a19c937 100644
--- a/STM32CubeIDE/Release/Application/User/STS/TOF/App/subdir.mk
+++ b/STM32CubeIDE/Release/Application/User/STS/TOF/App/subdir.mk
@@ -7,16 +7,19 @@
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 \
+/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 \
./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 \
./Application/User/STS/TOF/App/app_tof_vl53l0x_range.d
@@ -25,13 +28,15 @@ Application/User/STS/TOF/App/X-WL55_WLE5_53L0X.o: D:/ONEDRIVE/STM32WLV13/Project
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.o: D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/STS/TOF/App/app_tof.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_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_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 "$@"
clean: clean-Application-2f-User-2f-STS-2f-TOF-2f-App
clean-Application-2f-User-2f-STS-2f-TOF-2f-App:
- -$(RM) ./Application/User/STS/TOF/App/X-WL55_WLE5_53L0X.cyclo ./Application/User/STS/TOF/App/X-WL55_WLE5_53L0X.d ./Application/User/STS/TOF/App/X-WL55_WLE5_53L0X.o ./Application/User/STS/TOF/App/X-WL55_WLE5_53L0X.su ./Application/User/STS/TOF/App/app_tof.cyclo ./Application/User/STS/TOF/App/app_tof.d ./Application/User/STS/TOF/App/app_tof.o ./Application/User/STS/TOF/App/app_tof.su ./Application/User/STS/TOF/App/app_tof_vl53l0x_range.cyclo ./Application/User/STS/TOF/App/app_tof_vl53l0x_range.d ./Application/User/STS/TOF/App/app_tof_vl53l0x_range.o ./Application/User/STS/TOF/App/app_tof_vl53l0x_range.su
+ -$(RM) ./Application/User/STS/TOF/App/X-WL55_WLE5_53L0X.cyclo ./Application/User/STS/TOF/App/X-WL55_WLE5_53L0X.d ./Application/User/STS/TOF/App/X-WL55_WLE5_53L0X.o ./Application/User/STS/TOF/App/X-WL55_WLE5_53L0X.su ./Application/User/STS/TOF/App/app_tof.cyclo ./Application/User/STS/TOF/App/app_tof.d ./Application/User/STS/TOF/App/app_tof.o ./Application/User/STS/TOF/App/app_tof.su ./Application/User/STS/TOF/App/app_tof_peoplecount.cyclo ./Application/User/STS/TOF/App/app_tof_peoplecount.d ./Application/User/STS/TOF/App/app_tof_peoplecount.o ./Application/User/STS/TOF/App/app_tof_peoplecount.su ./Application/User/STS/TOF/App/app_tof_vl53l0x_range.cyclo ./Application/User/STS/TOF/App/app_tof_vl53l0x_range.d ./Application/User/STS/TOF/App/app_tof_vl53l0x_range.o ./Application/User/STS/TOF/App/app_tof_vl53l0x_range.su
.PHONY: clean-Application-2f-User-2f-STS-2f-TOF-2f-App
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.elf b/STM32CubeIDE/Release/WLE5CC_NODE_STS.elf
index 1b95cfe..d06dbc6 100644
Binary files a/STM32CubeIDE/Release/WLE5CC_NODE_STS.elf and b/STM32CubeIDE/Release/WLE5CC_NODE_STS.elf differ
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 7427775..8897217 100644
--- a/STM32CubeIDE/Release/makefile
+++ b/STM32CubeIDE/Release/makefile
@@ -18,9 +18,9 @@ RM := rm -rf
-include Drivers/BSP/Components/subdir.mk
-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
diff --git a/STM32CubeIDE/Release/sources.mk b/STM32CubeIDE/Release/sources.mk
index f021f94..14cf7f4 100644
--- a/STM32CubeIDE/Release/sources.mk
+++ b/STM32CubeIDE/Release/sources.mk
@@ -26,9 +26,9 @@ 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/vl53l0x \
+Application/User/STS/TOF/vl53l1x_uld \
Application/User/Startup \
Drivers/BSP/53L8A1 \
Drivers/BSP/Components \
diff --git a/STS/Core/Src/yunhorn_sts_process.c b/STS/Core/Src/yunhorn_sts_process.c
index b544663..b39c096 100644
--- a/STS/Core/Src/yunhorn_sts_process.c
+++ b/STS/Core/Src/yunhorn_sts_process.c
@@ -315,26 +315,14 @@ void STS_YunhornSTSEventP1_Process(void)
#if defined(STS_M1)
- PME_ON;
APP_LOG(TS_OFF, VLEVEL_M, "\r\n WATER LEAKAGE DETECTION Process \n");
- WATER_LEAKAGE_ENABLE;
- HAL_Delay(50);
- WATER_LEAKAGE_ENABLE;
LED1_ON;
- //HAL_Delay(40);
-
- sts_water_leakage_state = WATER_LEAKAGE_DATA;
+ 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);
- //LED1_OFF;
- //HAL_Delay(50);
- WATER_LEAKAGE_DISABLE;
- //HAL_Delay(50);
- //LED1_ON;
+
HAL_Delay(40);
- sts_water_leakage_state = WATER_LEAKAGE_DATA;
- APP_LOG(TS_OFF, VLEVEL_M, "\r\n DETECTION RESULT =%d \r\n", sts_water_leakage_state);
-
- //PME_OFF;
+ PME_OFF;
LED1_OFF;
#endif
@@ -593,9 +581,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)
{
- APP_LOG(TS_OFF, VLEVEL_M, "\r\n M1 sensor read =%d \r\n", WATER_LEAKAGE_DATA);
+
sts_m_sensor_data->on_off_event = sts_water_leakage_state;
- sts_m_sensor_data->on_off_event = WATER_LEAKAGE_DATA;
+ //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