From: penglei <1624952103@qq.com> Date: Sat, 31 Aug 2024 09:07:12 +0000 (+0800) Subject: 修复BUG 550 “运动,心率显示,刚开始每次心率都是一样的,实际心率灯没测量 ,将绝对静止判断时间调整为90分钟 X-Git-Tag: release_V1.2.70_20241020_135402~518^2~18^2~19 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F847%2F2;p=mirrors%2FFD230.git 修复BUG 550 “运动,心率显示,刚开始每次心率都是一样的,实际心率灯没测量 ,将绝对静止判断时间调整为90分钟 --- diff --git a/code/sdk/drivers/peripheral/cywee/src/main_dml.c b/code/sdk/drivers/peripheral/cywee/src/main_dml.c index 83ede1d48..364b37393 100644 --- a/code/sdk/drivers/peripheral/cywee/src/main_dml.c +++ b/code/sdk/drivers/peripheral/cywee/src/main_dml.c @@ -96,10 +96,10 @@ int cm__hs1__deinit(void); void cywee_set_abs_static(void) { - int time = get_config_heart_from_config_model(); + //int time = get_config_heart_from_config_model(); memset(&scl, 0, sizeof(scl)); scl.iData[0] = 1; - scl.iData[1] = time * 60; + scl.iData[1] = 90 * 60; CWM_SettingControl(SCL_ABS_STATIC_CONFIG, &scl); } @@ -470,9 +470,8 @@ void cywee_wearstatus_update(int wearstatus) if(is_abs_static_state == 1) { wearstatus = 0; + is_abs_static_state = 0; } - is_abs_static_state = 0; - memset(&csd, 0, sizeof(CUSTOM_OFFBODY_DETECT)); csd.sensorType = CUSTOM_OFFBODY_DETECT; csd.fData[0] = wearstatus; @@ -781,6 +780,7 @@ void CWM_AP_SensorListen(pSensorEVT_t sensorEVT) { { send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_DO_PPG_TEST); hrs_mode_state = 1; + hrs = 0;//运动开始,清零心率 } else { @@ -916,7 +916,7 @@ void CWM_AP_SensorListen(pSensorEVT_t sensorEVT) { c_activity_result_t.duration = (int)sensorEVT->fData[5]; c_activity_result_t.MHR_zone = (int)sensorEVT->fData[6]; c_activity_result_t.hrs = hrs; - + hrs = 0; //每次上报完 清除心率值 cywee_func(CYWEE_MSG_TYPE_ACTIVITY_UPDATE,&c_activity_result_t,sizeof(cywee_activity_result_t)); }else if((int)sensorEVT->fData[0] == 102) @@ -936,6 +936,7 @@ void CWM_AP_SensorListen(pSensorEVT_t sensorEVT) { c_activity_result_t.step_length = (float)sensorEVT->fData[6]; c_activity_result_t.pace = (int)sensorEVT->fData[7]; c_activity_result_t.hrs = hrs; + hrs = 0; //每次上报完 清除心率值 cywee_func(CYWEE_MSG_TYPE_ACTIVITY_UPDATE,&c_activity_result_t,sizeof(cywee_activity_result_t)); CustomEventPublish(TOPIC_EVENT_STEPDATA_UPDATE,&stepcount,sizeof(int)); } @@ -1244,8 +1245,8 @@ int cywee_main_dml(void) // CWM_Sensor_Enable(IDX_GYRO); CWM_Sensor_Enable(IDX_ALGO_NO_MOTION); //CWM_OS_dbgPrintf("[DBG] %s %d\n", __func__,__LINE__); - // CWM_Sensor_Enable(IDX_ALGO_ANY_MOTIOIN); - //CWM_Sensor_Enable(IDX_ALGO_ABSOLUTE_STATIC); + // CWM_Sensor_Enable(IDX_ALGO_ANY_MOTION); + CWM_Sensor_Enable(IDX_ALGO_ABSOLUTE_STATIC); //CWM_OS_dbgPrintf("[DBG] %s %d\n", __func__,__LINE__); cywee_restoreData();