From: hcj <1224667075@qq.com> Date: Tue, 8 Oct 2024 07:03:21 +0000 (+0800) Subject: 燃脂时间BUG修改 X-Git-Tag: release_V1.2.70_20241020_135402~144 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=d9ac074471c74220f976b6a71ff384b52f809822;p=mirrors%2FFD230.git 燃脂时间BUG修改 --- diff --git a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp index 5684d04cc..01559db79 100644 --- a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp +++ b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp @@ -1242,13 +1242,15 @@ char * ble_sywee_history(uint8_t day,uint16_t *len ,uint8_t type) int ret = uapi_get_timestampe_ss(&creationTime); uint32_t value=0; + uint16_t value_16=0; + float f_value=0; struct tm *timeinfo; time(&currtime); timeinfo = localtime(&currtime); printf("localtime %d",timeinfo->tm_min); creationTime=creationTime-(timeinfo->tm_min*60)-(timeinfo->tm_sec); - float f_value=0; + switch (type) { case 0x43: //同步步数历史数据 @@ -1266,13 +1268,13 @@ char * ble_sywee_history(uint8_t day,uint16_t *len ,uint8_t type) break; case 0x44://同步燃脂时间数据 - if(get_now_hour_data(&value,CYWEE_SAVE_DATA_FAT)) + if(get_now_hour_data(&value_16,CYWEE_SAVE_DATA_FAT)) { - if(value>0) + if(value_16>0) { memcpy(buf+size,&creationTime,4); size+=4; - int16 temp_value= (value); + int16 temp_value= (value_16); memcpy(buf+size,&(temp_value),2); size+=2; } diff --git a/code/sdk/drivers/peripheral/cywee/src/main_dml.c b/code/sdk/drivers/peripheral/cywee/src/main_dml.c index a8d1783d9..95023c3d1 100644 --- a/code/sdk/drivers/peripheral/cywee/src/main_dml.c +++ b/code/sdk/drivers/peripheral/cywee/src/main_dml.c @@ -326,15 +326,18 @@ void distances_history_save(void) void fat_history_save(void) { - uint16_t data= get_fat_time_data(); - data=data/60; - CWM_OS_saveData_history(&data,&history_fat_,sizeof(uint16_t),CYWEE_SAVE_DATA_FAT); + + int data= get_fat_time_data(); + uint16_t temp_data=0; + temp_data=data/60; + CWM_OS_saveData_history(&temp_data,&history_fat_,sizeof(uint16_t),CYWEE_SAVE_DATA_FAT); } int32_t get_now_hour_data(void*value, uint8_t type) { int data; float f_data; + int16_t data_; switch (type) { case CYWEE_SAVE_DATA_STEP: @@ -362,10 +365,10 @@ int32_t get_now_hour_data(void*value, uint8_t type) case CYWEE_SAVE_DATA_FAT: data= get_fat_time_data(); - int32_t data_=data/60-history_fat_; + data_=data/60-history_fat_; if(data_<0) return 0; - memcpy_s(value,4,&data,4); + memcpy_s(value,2,&data_,2); return 1; default: break;