优化睡眠卡片数据更新 1374/1 1374/head 1375/target/1 1376/target/1 1377/target/1 1378/target/1 1379/target/1
authorpenglei <1624952103@qq.com>
Fri, 8 Nov 2024 12:19:26 +0000 (20:19 +0800)
committerpenglei <1624952103@qq.com>
Fri, 8 Nov 2024 12:19:26 +0000 (20:19 +0800)
code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepModel.cpp
code/sdk/drivers/peripheral/cywee/src/main_dml.c

index 80b77bd..bb52bff 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: penglei 1624952103@qq.com
  * @Date: SLEPPNOTIFY24-06-26 19:36:48
  * @LastEditors: penglei 1624952103@qq.com
- * @LastEditTime: 2024-11-08 14:15:13
+ * @LastEditTime: 2024-11-08 20:05:21
  * @FilePath:
  * /FD230/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepModel.cpp
  * @Description:
@@ -791,6 +791,7 @@ namespace OHOS
       sleep_data.fall_asleep_timestamp = sleep_timestamp;
       sleep_data.wake_up_timestamp = wake_timestamp;
       sleep_data.total_time = totaltime;
+      sleep_update_timestamp = sleep_data.wake_up_timestamp;
     }
     // 更新小睡数据
     void update_nap_data(uint32_t sleep_timestamp, uint32_t wake_timestamp,
@@ -798,6 +799,7 @@ namespace OHOS
       nap_data.fall_asleep_timestamp = sleep_timestamp;  
       nap_data.wake_up_timestamp = wake_timestamp;  
       nap_data.total_time = totaltime;  
+      nap_update_timestamp = nap_data.wake_up_timestamp;
     }
 
 #ifdef __cplusplus
index 9626563..33499da 100644 (file)
@@ -167,8 +167,8 @@ void cywee_save_nap_data(cywee_inactivity_accumulate_time_t c_inactivity_accumul
 {
     if (access(nap_file_path, 0) == -1) //如果小睡文件不存在,创建睡眠文件夹
     {
+        char day[12] = {0};
         memset(dir_path,0,sizeof(dir_path));
-        memset(day,0,sizeof(day));
         memset(nap_file_path,0,sizeof(nap_file_path));
 
         uapi_get_YYMMDD_Time(day, '\0');