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;
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)
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];
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
void cywee_int_handler(void)
{
- if(cywee_switch == 1)
+ // if(cywee_switch == 1)
{
#ifdef AP_ENABLE_DML_SDO_LISTEN
cwm_lib_process();
\r
static uint8_t his_wear = 2;\r
static uint8_t wear_cnt = 0;\r
+static uint8_t acc_restart_flag = 0;\r
\r
void hx3695_hrs_ppg_Int_handle(void)\r
{\r
if(gsensordata[ii].x == 0.0f && gsensordata[ii].y == 0.0f && gsensordata[ii].z == 0.0f)\r
{\r
timeout++;\r
- if(timeout > 20)\r
+ if(timeout > 20 && !acc_restart_flag) //避免重复开关gsensor\r
{\r
do_cywee_service_check_msg(CYWEE_SERVICE_CMD_RESTART_ACC,NULL);\r
+ acc_restart_flag = 1;\r
}\r
}\r
else\r
{\r
timeout = 0;\r
+ acc_restart_flag = 0;\r
}\r
if(ii == 8)\r
{\r