diff --git a/Core/Src/yunhorn_sts_presence_rss.c b/Core/Src/yunhorn_sts_presence_rss.c index ecd3b8e..e101361 100644 --- a/Core/Src/yunhorn_sts_presence_rss.c +++ b/Core/Src/yunhorn_sts_presence_rss.c @@ -413,7 +413,7 @@ int sts_presence_rss_fall_rise_detection(void) APP_LOG(TS_OFF, VLEVEL_H,"First Half Presence Detection, Motion Count = %u \r\n", (int)motion_count); #endif // ******** Second Half detection of fall down and rise up -if (sts_presence_fall_detection == 1) +//if (sts_presence_fall_detection == 1) { set_default_fall_rise_configuration(presence_configuration); diff --git a/Core/Src/yunhorn_sts_process.c b/Core/Src/yunhorn_sts_process.c index 734a0ae..63ca460 100644 --- a/Core/Src/yunhorn_sts_process.c +++ b/Core/Src/yunhorn_sts_process.c @@ -72,7 +72,7 @@ extern volatile uint16_t sts_fall_rising_pattern_factor1; extern volatile uint16_t sts_roc_acc_standard_variance; extern uint8_t luminance_level; SysTime_t mems_event_time; - +volatile uint32_t last_sts_rss_time_stamp=0; extern volatile uint8_t sts_reed_hall_ext_int; volatile uint8_t sts_occupancy_status; volatile uint8_t sts_hall1_changed_flag=0, sts_hall2_changed_flag=0, last_sts_hall1_result=0, last_sts_hall2_result=0; @@ -864,11 +864,17 @@ void OnSensor2StateChanged(void) void OnSensor3StateChanged(void) { SysTime_t sensor_event_time = SysTimeGetMcuTime(); + if ((sensor_event_time.Seconds - last_sts_rss_time_stamp) < 3 ) //less than 3 seconds ... return for flipping filter + { + return ; + } + if (sts_rss_result == STS_RESULT_MOTION) { sts_o7_sensorData.event_sensor3_start_time = sensor_event_time.Seconds; sts_o7_sensorData.event_sensor3_duration = 0; } + last_sts_rss_time_stamp = sensor_event_time.Seconds; } void OnSensor4StateChanged(void)