From: penglei <1624952103@qq.com> Date: Thu, 17 Oct 2024 03:26:35 +0000 (+0800) Subject: 修复gsensor性别设置错误的bug,修复重复开启gsensor的bug X-Git-Tag: release_V1.2.70_20241020_135402~24^2~5 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=091ebf1c011e459271817149dbb6e5e6e0c978c6;p=mirrors%2FFD230.git 修复gsensor性别设置错误的bug,修复重复开启gsensor的bug --- diff --git a/code/sdk/drivers/peripheral/cywee/src/main_dml.c b/code/sdk/drivers/peripheral/cywee/src/main_dml.c index 7146f7ba9..6eedcd4c2 100644 --- a/code/sdk/drivers/peripheral/cywee/src/main_dml.c +++ b/code/sdk/drivers/peripheral/cywee/src/main_dml.c @@ -68,11 +68,11 @@ static int sedentary_interval = 1; static int sedentary_interval_count = 0; -#ifdef FD230 -static int cywee_switch = 1; -#else -static int cywee_switch = 0; -#endif +// #ifdef FD230 +// static int cywee_switch = 1; +// #else +// static int cywee_switch = 0; +// #endif static uint8_t cywee_is_active = 0; static uint8_t is_static_state = 0; @@ -157,7 +157,12 @@ uint8_t cywee_get_active_state(void) void cywee_stop(void) { - cywee_switch = 0; + // cywee_switch = 0; + memset(&scl, 0, sizeof(scl)); + scl.iData[0] = 1; + scl.iData[1] = 1; + scl.iData[2] = 0; + CWM_SettingControl(SCL_DML_DRV_ENABLE, &scl); } void cywee_get_acc_switch(int cmd) @@ -432,7 +437,7 @@ void cywee_set_user_info(void) memset(&scl, 0, sizeof(scl)); scl.iData[0] = 1; scl.iData[1] = user_info[0]; - scl.iData[2] = user_info[1]; + scl.iData[2] = !user_info[1]; //APP 1女 0男 scl.iData[3] = user_info[2]; scl.iData[4] = user_info[3]; scl.iData[5] = user_info[4]; @@ -1310,6 +1315,7 @@ int cywee_main_dml(void) memset(&scl, 0, sizeof(scl)); scl.iData[0] = 1; #ifdef AP_ENABLE_DML_SDO_LISTEN + // scl.iData[1] = 4+16; scl.iData[2] = 2+16; //分离式DML CWM_CustomSensorInput_Fifo_Init(25); #else @@ -1480,7 +1486,7 @@ int cwm_lib_process(void) //运行算法 void cywee_int_handler(void) { - if(cywee_switch == 1) + // if(cywee_switch == 1) { #ifdef AP_ENABLE_DML_SDO_LISTEN cwm_lib_process(); diff --git a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c index f6ffc4223..152079c81 100644 --- a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c +++ b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c @@ -2755,6 +2755,7 @@ hrs_sensor_data_t hrs_s_dat; static uint8_t his_wear = 2; static uint8_t wear_cnt = 0; +static uint8_t acc_restart_flag = 0; void hx3695_hrs_ppg_Int_handle(void) { @@ -2838,14 +2839,16 @@ void hx3695_hrs_ppg_Int_handle(void) if(gsensordata[ii].x == 0.0f && gsensordata[ii].y == 0.0f && gsensordata[ii].z == 0.0f) { timeout++; - if(timeout > 20) + if(timeout > 20 && !acc_restart_flag) //避免重复开关gsensor { do_cywee_service_check_msg(CYWEE_SERVICE_CMD_RESTART_ACC,NULL); + acc_restart_flag = 1; } } else { timeout = 0; + acc_restart_flag = 0; } if(ii == 8) {