diff --git a/Core/Src/sts_lamp_bar.c b/Core/Src/sts_lamp_bar.c index 947aca9..15538a8 100644 --- a/Core/Src/sts_lamp_bar.c +++ b/Core/Src/sts_lamp_bar.c @@ -384,17 +384,20 @@ void STS_Combined_Status_Processing(void) last_lamp_bar_color = sts_lamp_bar_color; } } + + STS_Lamp_Bar_Refresh(); #if 1 //if ((sts_rss_result_changed_flag)|| (sts_reed_hall_changed_flag) || (sts_tof_result_changed_flag) || (sts_water_leakage_changed_flag)) { - sensor_data_ready = 1; - STS_PRESENCE_SENSOR_Prepare_Send_Data(); + sts_rss_result_changed_flag =0; sts_reed_hall_changed_flag =0; sts_tof_result_changed_flag =0; #ifdef STS_M1 sts_water_leakage_changed_flag=0; #endif + sensor_data_ready = 1; + STS_PRESENCE_SENSOR_Prepare_Send_Data(); } #endif } diff --git a/Core/Src/yunhorn_sts_presence_rss.c b/Core/Src/yunhorn_sts_presence_rss.c index 976cfdb..ca7813a 100644 --- a/Core/Src/yunhorn_sts_presence_rss.c +++ b/Core/Src/yunhorn_sts_presence_rss.c @@ -290,13 +290,13 @@ static void print_result(acc_detector_presence_result_t result) { uint32_t detected_zone = (uint32_t)((float)(result.presence_distance - DEFAULT_START_M) / (float)DEFAULT_ZONE_LENGTH); - APP_LOG(TS_OFF, VLEVEL_M,"Motion in zone: %u, distance: %d, score: %d\n", (unsigned int)detected_zone, + APP_LOG(TS_OFF, VLEVEL_H,"Motion in zone: %u, distance: %d, score: %d\n", (unsigned int)detected_zone, (int)(result.presence_distance * 1000.0f), (int)(result.presence_score * 1000.0f)); } else { - APP_LOG(TS_OFF, VLEVEL_M,"No motion, score: %d\n", (int)(result.presence_score * 1000.0f)); + APP_LOG(TS_OFF, VLEVEL_H,"No motion, score: %d\n", (int)(result.presence_score * 1000.0f)); } } @@ -399,7 +399,7 @@ int sts_presence_rss_fall_rise_detection(void) } acc_detector_presence_deactivate(handle); - APP_LOG(TS_OFF, VLEVEL_H,"First Half Presence Detection, Motion Count = %u \r\n", (int)motion_count); + APP_LOG(TS_OFF, VLEVEL_M,"First Half Presence Detection, Motion Count = %u \r\n", (int)motion_count); // ******** Second Half detection of fall down and rise up @@ -457,16 +457,16 @@ int sts_presence_rss_fall_rise_detection(void) acc_integration_sleep_ms(1000 / DEFAULT_UPDATE_RATE_PRESENCE); // DEFAULT_UPDATE_RATE); } - APP_LOG(TS_OFF, VLEVEL_H,"Second Half, Fall Rise Detection, Motion Count = %u \r\n", (int)motion_count); + APP_LOG(TS_OFF, VLEVEL_M,"Second Half, Fall Rise Detection, Motion Count = %u \r\n", (int)motion_count); sts_rss_result = (average_result > 3)? 1: 0; average_distance = (1000.0f*average_distance)/average_result; // in meters average_score = (1000.0f*average_score)/average_result; sts_presence_rss_distance = average_distance; sts_presence_rss_score = average_score; - if (sts_rss_result) //if (average_score !=0) //if (sts_rss_result) + if (average_score) //if (average_score !=0) //if (sts_rss_result) { - APP_LOG(TS_OFF, VLEVEL_L,"\r\n######## Motion: %u Distance=%u mm, Score=%u Average_result=%u out of %u \r\n", + APP_LOG(TS_OFF, VLEVEL_M,"\r\n######## Motion: %u Distance=%u mm, Score=%u Average_result=%u out of %u \r\n", (uint8_t)sts_rss_result,(int) average_distance, (int)(average_score), (int)average_result, (int)iterations); } diff --git a/Core/Src/yunhorn_sts_process.c b/Core/Src/yunhorn_sts_process.c index 6b73bf0..c6bb5cc 100644 --- a/Core/Src/yunhorn_sts_process.c +++ b/Core/Src/yunhorn_sts_process.c @@ -101,8 +101,8 @@ volatile uint8_t sts_rss_result_changed_flag = 0; volatile uint8_t sts_rss_result = STS_RESULT_NO_MOTION; volatile uint8_t sts_rss_2nd_result = STS_RESULT_NO_MOTION; //2nd RSS sensor status volatile uint8_t sts_tof_result = STS_RESULT_NO_MOTION; -volatile uint8_t last_sts_rss_result; -extern volatile uint8_t last_sts_rss_result; +volatile uint8_t last_sts_rss_result=0; + //extern volatile uint8_t last_sts_reed_hall_result; extern volatile uint8_t last_lamp_bar_color; extern volatile float sts_presence_rss_distance; diff --git a/STM32CubeIDE/Release/STS_O7.bin b/STM32CubeIDE/Release/STS_O7.bin index 8ecfad6..23fc555 100644 Binary files a/STM32CubeIDE/Release/STS_O7.bin and b/STM32CubeIDE/Release/STS_O7.bin differ