From: penglei <1624952103@qq.com> Date: Tue, 30 Sep 2025 10:08:17 +0000 (+0800) Subject: 修复运动数据存储 X-Git-Tag: V1.0.9_20251128_194606_LN~250^2~22^2 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F2458%2Fhead;p=mirrors%2FFD230.git 修复运动数据存储 --- diff --git a/code/sdk/zhihui/drivers/cywee/dml/cywee_data.c b/code/sdk/zhihui/drivers/cywee/dml/cywee_data.c index a665ae044..b3f6fca2e 100644 --- a/code/sdk/zhihui/drivers/cywee/dml/cywee_data.c +++ b/code/sdk/zhihui/drivers/cywee/dml/cywee_data.c @@ -2,7 +2,7 @@ * @Author: penglei 1624952103@qq.com * @Date: 2024-04-08 14:53:31 * @LastEditors: penglei 1624952103@qq.com - * @LastEditTime: 2025-07-10 14:31:06 + * @LastEditTime: 2025-09-30 18:03:35 * @FilePath: /FD230/code/sdk/drivers/peripheral/cywee/service/cywee_dml.c * @Description: * @@ -262,10 +262,10 @@ void cywee_save_data(void) } uapi_dev_runtime_set_goal_storage_status(1); - int step = cywee_get_sport_data(STEP) + cywee_get_sport_data(HISTORY_STEP); - int calories = cywee_get_sport_data(CALORIES) + cywee_get_sport_data(HISTORY_CALORIES); - int distances = cywee_get_sport_data(DISTANCE) + cywee_get_sport_data(HISTORY_DISTANCE); - int fat = cywee_get_sport_data(FAT) + cywee_get_sport_data(HISTORY_FAT); + int step = cywee_get_sport_data(STEP); + int calories = cywee_get_sport_data(NEW_CALORIES) + cywee_get_sport_data(HISTORY_CALORIES); + int distances = cywee_get_sport_data(NEW_DISTANCE) + cywee_get_sport_data(HISTORY_DISTANCE); + int fat = cywee_get_sport_data(NEW_FAT) + cywee_get_sport_data(HISTORY_FAT); int history_step_ = cywee_get_sport_data(HISTORY_STEP_); int history_calories_ = cywee_get_sport_data(HISTORY_CALORIES_); @@ -303,6 +303,7 @@ void cywee_restoreData(void) CWM_OS_OneHourAgo_restoreData(&history_step_,sizeof(int),STEP); cywee_set_sport_data(history_step,HISTORY_STEP); cywee_set_sport_data(history_step_,HISTORY_STEP_); + cywee_set_sport_data(history_step,STEP); CWM_OS_restoreData(&history_calories,sizeof(int),CALORIES); CWM_OS_OneHourAgo_restoreData(&history_calories_,sizeof(float),CALORIES); diff --git a/code/sdk/zhihui/drivers/cywee/dml/cywee_dml.c b/code/sdk/zhihui/drivers/cywee/dml/cywee_dml.c index a77313ce1..ab786e352 100644 --- a/code/sdk/zhihui/drivers/cywee/dml/cywee_dml.c +++ b/code/sdk/zhihui/drivers/cywee/dml/cywee_dml.c @@ -893,6 +893,9 @@ void cywee_set_sport_data(uint32_t data,uint8_t type) { switch (type) { + case STEP: + stepcount = data; + break; case HISTORY_STEP: history_step = data; break; @@ -1619,7 +1622,7 @@ void CWM_AP_SensorListen(pSensorEVT_t sensorEVT) { CustomEventPublish(TOPIC_EVENT_AR_ALERT_TYPE_UPDATE,&ar_alert_type,sizeof(int)); }else{ - stepcount = (int)sensorEVT->fData[1]; + stepcount += (int)sensorEVT->fData[1]; memset(&c_act_result_t,0,sizeof(act_result_t)); c_act_result_t.activity_mode = (int)sensorEVT->fData[0]; c_act_result_t.steps = stepcount;