From 0ecc519865fd509bb17944548fef81ce97f9feca Mon Sep 17 00:00:00 2001 From: penglei <1624952103@qq.com> Date: Tue, 30 Sep 2025 18:08:17 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E5=A4=8D=E8=BF=90=E5=8A=A8=E6=95=B0?= =?utf8?q?=E6=8D=AE=E5=AD=98=E5=82=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- code/sdk/zhihui/drivers/cywee/dml/cywee_data.c | 11 ++++++----- code/sdk/zhihui/drivers/cywee/dml/cywee_dml.c | 5 ++++- 2 files changed, 10 insertions(+), 6 deletions(-) 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; -- 2.17.1