睡眠时间戳同步算法库更新优化(补)
authorpenglei <1624952103@qq.com>
Wed, 6 Nov 2024 09:36:05 +0000 (17:36 +0800)
committerpenglei <1624952103@qq.com>
Wed, 6 Nov 2024 09:36:05 +0000 (17:36 +0800)
code/sdk/drivers/peripheral/cywee/src/main_dml.c

index c37b88d..edb5b81 100644 (file)
@@ -366,8 +366,11 @@ void cywee_set_sleep_stat_data(cywee_inactivity_result_t c_inactivity_result_t)
         else if(sleep_stat[stat_num].stat == 4)
         {
             //目前cywee出睡时间戳有bug 暂时先用系统时间戳
-            // uapi_get_timestampe_ss(&timestamp);
-            // sleep_stat[stat_num].timestamp = timestamp;
+            if(sleep_stat[stat_num].timestamp < fall_asleep_timestamp) //如果出睡时间戳小于入睡时间戳 获取系统时间戳作为出睡时间戳
+            {
+                uapi_get_timestampe_ss(&timestamp);
+                sleep_stat[stat_num].timestamp = timestamp;
+            }
             wake_up_timestamp = sleep_stat[stat_num].timestamp;
             sleep_update_timestamp = wake_up_timestamp;
         }