diff --git a/Core/Inc/yunhorn_sts_sensors.h b/Core/Inc/yunhorn_sts_sensors.h index a5f1aee..91e9a28 100644 --- a/Core/Inc/yunhorn_sts_sensors.h +++ b/Core/Inc/yunhorn_sts_sensors.h @@ -213,7 +213,8 @@ enum sts_presence_fall_detection_type { STS_PRESENCE_RISING, STS_PRESENCE_LAYDOWN, STS_PRESENCE_UNCONSCIOUS, - STS_PRESENCE_STAYSTILL + STS_PRESENCE_STAYSTILL, + STS_PRESENCE_NO_MOVEMENT }; enum sts_sensor_result_t { diff --git a/Core/Src/yunhorn_sts_process.c b/Core/Src/yunhorn_sts_process.c index 2023cc2..ffa34dc 100644 --- a/Core/Src/yunhorn_sts_process.c +++ b/Core/Src/yunhorn_sts_process.c @@ -952,28 +952,32 @@ void OnSensor3BStateChanged(void) switch (sts_fall_rising_detected_result) { case STS_PRESENCE_NONE: - sts_o7_sensorData.event_sensor3_motion_stop_time = sensor_event_time.Seconds; - break; + sts_o7_sensorData.event_sensor3_motion_stop_time = sensor_event_time.Seconds; + break; case STS_PRESENCE_FALL: - if (motion_in_hs_zone[0][motion_detected_count]) - sts_o7_sensorData.event_sensor3_fall_start_time = sensor_event_time.Seconds; - sts_o7_sensorData.event_sensor3_fall_duration = 0; - break; + if (motion_in_hs_zone[0][motion_detected_count]) { + sts_o7_sensorData.event_sensor3_fall_start_time = sensor_event_time.Seconds; + sts_o7_sensorData.event_sensor3_fall_duration = 0; + } + break; case STS_PRESENCE_RISING: - break; + break; case STS_PRESENCE_LAYDOWN: case STS_PRESENCE_UNCONSCIOUS: - sts_o7_sensorData.fall_laydown_duration = 0; - break; - case STS_PRESENCE_STAYSTILL: + sts_o7_sensorData.fall_laydown_duration = 0; + break; + + case STS_PRESENCE_STAYSTILL: + case STS_PRESENCE_NO_MOVEMENT: + + break; - break; default: - break; + break; }