diff --git a/Core/Inc/sys_conf.h b/Core/Inc/sys_conf.h
index c8e4d0f..f10502a 100644
--- a/Core/Inc/sys_conf.h
+++ b/Core/Inc/sys_conf.h
@@ -47,7 +47,7 @@ extern "C" {
/**
* @brief Verbose level for all trace logs
*/
-#define VERBOSE_LEVEL VLEVEL_L
+#define VERBOSE_LEVEL VLEVEL_M
/**
* @brief Enable trace logs
diff --git a/LoRaWAN/App/lora_app.c b/LoRaWAN/App/lora_app.c
index 6b10a6a..4afbcf9 100644
--- a/LoRaWAN/App/lora_app.c
+++ b/LoRaWAN/App/lora_app.c
@@ -1405,6 +1405,9 @@ static void OnJoinRequest(LmHandlerJoinParams_t *joinParams)
LmHandlerParams.IsTxConfirmed = true;
LmHandlerErrorStatus_t status = LmHandlerSend(&AppData, LmHandlerParams.IsTxConfirmed, false);
if (status ==LORAMAC_HANDLER_SUCCESS ) LmHandlerParams.IsTxConfirmed = false;
+
+ STS_SENSOR_Function_Test_Process();
+
}
else
{
@@ -1414,6 +1417,7 @@ static void OnJoinRequest(LmHandlerJoinParams_t *joinParams)
APP_LOG(TS_OFF, VLEVEL_H, "###### U/L FRAME:JOIN | DR:%d | PWR:%d\r\n", joinParams->Datarate, joinParams->TxPower);
}
+
// UTIL_TIMER_Start(&YunhornSTSWakeUpScanTimer);
/* USER CODE END OnJoinRequest_1 */
}
diff --git a/STM32CubeIDE/.settings/language.settings.xml b/STM32CubeIDE/.settings/language.settings.xml
index 9e6a728..b12f9ea 100644
--- a/STM32CubeIDE/.settings/language.settings.xml
+++ b/STM32CubeIDE/.settings/language.settings.xml
@@ -5,7 +5,7 @@
-
+
@@ -16,7 +16,7 @@
-
+
diff --git a/STM32CubeIDE/Release/Application/User/Core/subdir.mk b/STM32CubeIDE/Release/Application/User/Core/subdir.mk
index f85e725..df1f29e 100644
--- a/STM32CubeIDE/Release/Application/User/Core/subdir.mk
+++ b/STM32CubeIDE/Release/Application/User/Core/subdir.mk
@@ -1,6 +1,6 @@
################################################################################
# Automatically-generated file. Do not edit!
-# Toolchain: GNU Tools for STM32 (12.3.rel1)
+# Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
diff --git a/STM32CubeIDE/Release/Application/User/LoRaWAN/App/subdir.mk b/STM32CubeIDE/Release/Application/User/LoRaWAN/App/subdir.mk
index f7cc4b2..65c8e93 100644
--- a/STM32CubeIDE/Release/Application/User/LoRaWAN/App/subdir.mk
+++ b/STM32CubeIDE/Release/Application/User/LoRaWAN/App/subdir.mk
@@ -1,6 +1,6 @@
################################################################################
# Automatically-generated file. Do not edit!
-# Toolchain: GNU Tools for STM32 (12.3.rel1)
+# Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
diff --git a/STM32CubeIDE/Release/Application/User/LoRaWAN/Target/subdir.mk b/STM32CubeIDE/Release/Application/User/LoRaWAN/Target/subdir.mk
index d7ad605..a11353d 100644
--- a/STM32CubeIDE/Release/Application/User/LoRaWAN/Target/subdir.mk
+++ b/STM32CubeIDE/Release/Application/User/LoRaWAN/Target/subdir.mk
@@ -1,6 +1,6 @@
################################################################################
# Automatically-generated file. Do not edit!
-# Toolchain: GNU Tools for STM32 (12.3.rel1)
+# Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
diff --git a/STM32CubeIDE/Release/Application/User/STS/Core/Src/subdir.mk b/STM32CubeIDE/Release/Application/User/STS/Core/Src/subdir.mk
index b2e6241..63c75f4 100644
--- a/STM32CubeIDE/Release/Application/User/STS/Core/Src/subdir.mk
+++ b/STM32CubeIDE/Release/Application/User/STS/Core/Src/subdir.mk
@@ -1,6 +1,6 @@
################################################################################
# Automatically-generated file. Do not edit!
-# Toolchain: GNU Tools for STM32 (12.3.rel1)
+# Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
diff --git a/STM32CubeIDE/Release/Application/User/STS/TOF/App/subdir.mk b/STM32CubeIDE/Release/Application/User/STS/TOF/App/subdir.mk
index 72b511e..55b12d7 100644
--- a/STM32CubeIDE/Release/Application/User/STS/TOF/App/subdir.mk
+++ b/STM32CubeIDE/Release/Application/User/STS/TOF/App/subdir.mk
@@ -1,6 +1,6 @@
################################################################################
# Automatically-generated file. Do not edit!
-# Toolchain: GNU Tools for STM32 (12.3.rel1)
+# Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
diff --git a/STM32CubeIDE/Release/Application/User/STS/TOF/Target/subdir.mk b/STM32CubeIDE/Release/Application/User/STS/TOF/Target/subdir.mk
index e7a9bbd..e5922cd 100644
--- a/STM32CubeIDE/Release/Application/User/STS/TOF/Target/subdir.mk
+++ b/STM32CubeIDE/Release/Application/User/STS/TOF/Target/subdir.mk
@@ -1,6 +1,6 @@
################################################################################
# Automatically-generated file. Do not edit!
-# Toolchain: GNU Tools for STM32 (12.3.rel1)
+# Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
diff --git a/STM32CubeIDE/Release/Application/User/Startup/subdir.mk b/STM32CubeIDE/Release/Application/User/Startup/subdir.mk
index 140938e..cc5db04 100644
--- a/STM32CubeIDE/Release/Application/User/Startup/subdir.mk
+++ b/STM32CubeIDE/Release/Application/User/Startup/subdir.mk
@@ -1,6 +1,6 @@
################################################################################
# Automatically-generated file. Do not edit!
-# Toolchain: GNU Tools for STM32 (12.3.rel1)
+# Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
diff --git a/STM32CubeIDE/Release/Drivers/BSP/53L8A1/subdir.mk b/STM32CubeIDE/Release/Drivers/BSP/53L8A1/subdir.mk
index e703e10..e71993d 100644
--- a/STM32CubeIDE/Release/Drivers/BSP/53L8A1/subdir.mk
+++ b/STM32CubeIDE/Release/Drivers/BSP/53L8A1/subdir.mk
@@ -1,6 +1,6 @@
################################################################################
# Automatically-generated file. Do not edit!
-# Toolchain: GNU Tools for STM32 (12.3.rel1)
+# Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
diff --git a/STM32CubeIDE/Release/Drivers/BSP/Components/subdir.mk b/STM32CubeIDE/Release/Drivers/BSP/Components/subdir.mk
index 74cc73a..f0fdf6b 100644
--- a/STM32CubeIDE/Release/Drivers/BSP/Components/subdir.mk
+++ b/STM32CubeIDE/Release/Drivers/BSP/Components/subdir.mk
@@ -1,6 +1,6 @@
################################################################################
# Automatically-generated file. Do not edit!
-# Toolchain: GNU Tools for STM32 (12.3.rel1)
+# Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
diff --git a/STM32CubeIDE/Release/Drivers/CMSIS/subdir.mk b/STM32CubeIDE/Release/Drivers/CMSIS/subdir.mk
index f9a98ba..1cd765c 100644
--- a/STM32CubeIDE/Release/Drivers/CMSIS/subdir.mk
+++ b/STM32CubeIDE/Release/Drivers/CMSIS/subdir.mk
@@ -1,6 +1,6 @@
################################################################################
# Automatically-generated file. Do not edit!
-# Toolchain: GNU Tools for STM32 (12.3.rel1)
+# Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
diff --git a/STM32CubeIDE/Release/Drivers/STM32WLxx_HAL_Driver/subdir.mk b/STM32CubeIDE/Release/Drivers/STM32WLxx_HAL_Driver/subdir.mk
index 5e5aa98..0d5d681 100644
--- a/STM32CubeIDE/Release/Drivers/STM32WLxx_HAL_Driver/subdir.mk
+++ b/STM32CubeIDE/Release/Drivers/STM32WLxx_HAL_Driver/subdir.mk
@@ -1,6 +1,6 @@
################################################################################
# Automatically-generated file. Do not edit!
-# Toolchain: GNU Tools for STM32 (12.3.rel1)
+# Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
diff --git a/STM32CubeIDE/Release/Middlewares/LoRaWAN/subdir.mk b/STM32CubeIDE/Release/Middlewares/LoRaWAN/subdir.mk
index ba0a44b..eae0ba4 100644
--- a/STM32CubeIDE/Release/Middlewares/LoRaWAN/subdir.mk
+++ b/STM32CubeIDE/Release/Middlewares/LoRaWAN/subdir.mk
@@ -1,6 +1,6 @@
################################################################################
# Automatically-generated file. Do not edit!
-# Toolchain: GNU Tools for STM32 (12.3.rel1)
+# Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
diff --git a/STM32CubeIDE/Release/Middlewares/SubGHz_Phy/subdir.mk b/STM32CubeIDE/Release/Middlewares/SubGHz_Phy/subdir.mk
index b9ca60b..da9d856 100644
--- a/STM32CubeIDE/Release/Middlewares/SubGHz_Phy/subdir.mk
+++ b/STM32CubeIDE/Release/Middlewares/SubGHz_Phy/subdir.mk
@@ -1,6 +1,6 @@
################################################################################
# Automatically-generated file. Do not edit!
-# Toolchain: GNU Tools for STM32 (12.3.rel1)
+# Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
diff --git a/STM32CubeIDE/Release/Utilities/subdir.mk b/STM32CubeIDE/Release/Utilities/subdir.mk
index de816b4..826d8ef 100644
--- a/STM32CubeIDE/Release/Utilities/subdir.mk
+++ b/STM32CubeIDE/Release/Utilities/subdir.mk
@@ -1,6 +1,6 @@
################################################################################
# Automatically-generated file. Do not edit!
-# Toolchain: GNU Tools for STM32 (12.3.rel1)
+# Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
diff --git a/STM32CubeIDE/Release/WLE5CC_NODE_STS.bin b/STM32CubeIDE/Release/WLE5CC_NODE_STS.bin
index d828b0c..11a06ca 100644
Binary files a/STM32CubeIDE/Release/WLE5CC_NODE_STS.bin and b/STM32CubeIDE/Release/WLE5CC_NODE_STS.bin differ
diff --git a/STM32CubeIDE/Release/WLE5CC_NODE_STS.elf b/STM32CubeIDE/Release/WLE5CC_NODE_STS.elf
index 5f27c32..14ce41d 100644
Binary files a/STM32CubeIDE/Release/WLE5CC_NODE_STS.elf and b/STM32CubeIDE/Release/WLE5CC_NODE_STS.elf differ
diff --git a/STM32CubeIDE/Release/makefile b/STM32CubeIDE/Release/makefile
index 36e5c5c..20dc099 100644
--- a/STM32CubeIDE/Release/makefile
+++ b/STM32CubeIDE/Release/makefile
@@ -1,6 +1,6 @@
################################################################################
# Automatically-generated file. Do not edit!
-# Toolchain: GNU Tools for STM32 (12.3.rel1)
+# Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################
-include ../makefile.init
diff --git a/STM32CubeIDE/Release/objects.mk b/STM32CubeIDE/Release/objects.mk
index a5103de..515d2a4 100644
--- a/STM32CubeIDE/Release/objects.mk
+++ b/STM32CubeIDE/Release/objects.mk
@@ -1,6 +1,6 @@
################################################################################
# Automatically-generated file. Do not edit!
-# Toolchain: GNU Tools for STM32 (12.3.rel1)
+# Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################
USER_OBJS :=
diff --git a/STM32CubeIDE/Release/sources.mk b/STM32CubeIDE/Release/sources.mk
index 4110fdd..3380d01 100644
--- a/STM32CubeIDE/Release/sources.mk
+++ b/STM32CubeIDE/Release/sources.mk
@@ -1,6 +1,6 @@
################################################################################
# Automatically-generated file. Do not edit!
-# Toolchain: GNU Tools for STM32 (12.3.rel1)
+# Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################
ELF_SRCS :=
diff --git a/STS/Core/Src/yunhorn_sts_process.c b/STS/Core/Src/yunhorn_sts_process.c
index 5005506..56bf761 100644
--- a/STS/Core/Src/yunhorn_sts_process.c
+++ b/STS/Core/Src/yunhorn_sts_process.c
@@ -2050,6 +2050,7 @@ void STS_SENSOR_Distance_Test_Process(void)
do
{
range_once = (uint16_t)MX_TOF_Ranging_Process();
+ APP_LOG(TS_OFF, VLEVEL_M, "\r\n Repeat=%d Distance=%d \r\n", rpt, range_once);
if (range_once > 0)
{
rpt++;
diff --git a/STS/TOF/App/app_tof.c b/STS/TOF/App/app_tof.c
index 1162737..6d38280 100644
--- a/STS/TOF/App/app_tof.c
+++ b/STS/TOF/App/app_tof.c
@@ -184,6 +184,10 @@ void STS_LMZ_Ambient_Height_Scan_Process(void)
#if 1
uint8_t i=0;
uint32_t range_distance =0;
+ uint8_t j=0;
+ uint32_t bg_distance[64]={0};
+ uint8_t idx[64]={0};
+ uint8_t IDX_LEN=10;
for (i=0; i<64; i++)
{
@@ -203,7 +207,7 @@ void STS_LMZ_Ambient_Height_Scan_Process(void)
//APP_LOG(TS_OFF, VLEVEL_M, "\r\nReconfig ----> Threshold High=%d mm, Low=%d mm \r\n", sts_high_threshold, sts_low_threshold);
STS_TOF_L8_Reconfig();
-
+#if 1
status = VL53L8A1_RANGING_SENSOR_Start(VL53L8A1_DEV_CENTER, RS_MODE_ASYNC_CONTINUOUS);
if (status != BSP_ERROR_NONE)
@@ -211,16 +215,40 @@ void STS_LMZ_Ambient_Height_Scan_Process(void)
printf("VL53L8A1_RANGING_SENSOR_Start failed\n");
while (1);
}
+#endif
- if (ToF_EventDetected != 0)
+ for (j=0; j < IDX_LEN; j++)
{
- ToF_EventDetected = 0;
- status = VL53L8A1_RANGING_SENSOR_GetDistance(VL53L8A1_DEV_CENTER, &Result);
- if (status != BSP_ERROR_NONE)
- {
- APP_LOG(TS_OFF, VLEVEL_M, "\r\n x \r\n");
- }
+
+ //APP_LOG(TS_OFF, VLEVEL_M, "\r\n Cycle:%d \r\n", j);
+ MX_53L8A1_ThresholdDetection_Process();
+
+ //if (ToF_EventDetected != 0)
+ {
+ // ToF_EventDetected = 0;
+ // status = VL53L8A1_RANGING_SENSOR_GetDistance(VL53L8A1_DEV_CENTER, &Result);
+ //if (status != BSP_ERROR_NONE)
+ //{
+ //APP_LOG(TS_OFF, VLEVEL_M, "\r\n x \r\n");
+ //} else {
+ for (i = 0; i < 64; i++)
+ {
+ if (i % 8 ==0) APP_LOG(TS_OFF, VLEVEL_H, "\r\n[cm] ");
+ if ((Result.ZoneResult[i].NumberOfTargets > 0))
+ {
+ bg_distance[i] += (uint32_t) Result.ZoneResult[i].Distance[0];
+ idx[i] ++;
+ APP_LOG(TS_OFF, VLEVEL_H, "|%3d ", Result.ZoneResult[i].Distance[0]/10);
+ } else APP_LOG(TS_OFF, VLEVEL_H, "|%3d ", 0);
+
+ }
+
+ //}
+ }
+ HAL_Delay(50);
}
+ for (i=0; i< 64; i++)
+ bg_distance[i] /= idx[i];
//STS_TOF_L8_Process();
@@ -231,10 +259,11 @@ void STS_LMZ_Ambient_Height_Scan_Process(void)
{
/* Print distance and status */
if (i%8==0) APP_LOG(TS_OFF, VLEVEL_L, "\r\n[cm]|");
- if ((Result.ZoneResult[i].NumberOfTargets > 0))
+ // if ((Result.ZoneResult[i].NumberOfTargets > 0))
+ if (1)
{
- range_distance = (uint32_t)Result.ZoneResult[i].Distance[0];
-
+ // range_distance = (uint32_t)Result.ZoneResult[i].Distance[0];
+ range_distance = (uint32_t)bg_distance[i];
fhmos_bg.h2cm[i] = abs(sts_sensor_install_height - range_distance)/20; // in 2 cm
if (2*fhmos_bg.h2cm[i] < fhmos_cfg.th_gesture_mask_off_height_cm)
@@ -545,9 +574,9 @@ static void MX_53L8A1_ThresholdDetection_Process(void)
//ITConfig.LowThreshold = LOW_THRESHOLD; /* mm */
//ITConfig.HighThreshold = HIGH_THRESHOLD; /* mm */
- sts_high_threshold = sts_sensor_install_height;
+ sts_high_threshold = sts_sensor_install_height+ 400;
sts_low_threshold = sts_high_threshold - 1400;
- APP_LOG(TS_OFF, VLEVEL_M, "\r\n Threshold High=%4d, Low=%4d \r\n", sts_high_threshold, sts_low_threshold);
+ APP_LOG(TS_OFF, VLEVEL_H, "\r\n Threshold High=%4d, Low=%4d \r\n", sts_high_threshold, sts_low_threshold);
ITConfig.LowThreshold = sts_low_threshold;
ITConfig.HighThreshold = sts_high_threshold;