--- ADD NO_MOVEMENT, UNCONCIOUS, STAYSTILL

This commit is contained in:
Yunhorn 2024-07-15 15:38:29 +08:00
parent 2bf4134f7e
commit 3feaffc5c2
2 changed files with 18 additions and 13 deletions

View File

@ -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 {

View File

@ -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;
}