From 58aaabaec0044c81f2826ea5900b68bd24b11874 Mon Sep 17 00:00:00 2001 From: penglei <1624952103@qq.com> Date: Sat, 31 Aug 2024 17:07:12 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E5=A4=8DBUG=20550=20=E2=80=9C=E8=BF=90?= =?utf8?q?=E5=8A=A8=EF=BC=8C=E5=BF=83=E7=8E=87=E6=98=BE=E7=A4=BA=EF=BC=8C?= =?utf8?q?=E5=88=9A=E5=BC=80=E5=A7=8B=E6=AF=8F=E6=AC=A1=E5=BF=83=E7=8E=87?= =?utf8?q?=E9=83=BD=E6=98=AF=E4=B8=80=E6=A0=B7=E7=9A=84=EF=BC=8C=E5=AE=9E?= =?utf8?q?=E9=99=85=E5=BF=83=E7=8E=87=E7=81=AF=E6=B2=A1=E6=B5=8B=E9=87=8F?= =?utf8?q?=20=20=EF=BC=8C=E5=B0=86=E7=BB=9D=E5=AF=B9=E9=9D=99=E6=AD=A2?= =?utf8?q?=E5=88=A4=E6=96=AD=E6=97=B6=E9=97=B4=E8=B0=83=E6=95=B4=E4=B8=BA9?= =?utf8?q?0=E5=88=86=E9=92=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- code/sdk/drivers/peripheral/cywee/src/main_dml.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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(); -- 2.17.1