From: penglei <1624952103@qq.com> Date: Sat, 26 Oct 2024 06:51:38 +0000 (+0800) Subject: 优化凌晨清除运动数据 调整部分产测指令 优化绝对静止判断处理 X-Git-Tag: fd230_release_V1.3.102~181^2~14 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=f32891b97a5ebf9ae5321f9e7350e2b94bde3413;p=mirrors%2FFD230.git 优化凌晨清除运动数据 调整部分产测指令 优化绝对静止判断处理 --- diff --git a/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c b/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c index 93146e182..7470baa3e 100644 --- a/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c +++ b/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c @@ -2,7 +2,7 @@ * @Author: penglei 1624952103@qq.com * @Date: 2024-06-17 14:31:08 * @LastEditors: penglei 1624952103@qq.com - * @LastEditTime: 2024-10-23 19:40:27 + * @LastEditTime: 2024-10-26 14:25:38 * @FilePath: /FD230/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c * @Description: * @@ -164,14 +164,6 @@ void ble_acc_check_timer_callback(void) 6); } - - uint32_t executions_num;//执行次数 - uint32_t fail_num; //失败次数 - uint32_t target_hour; //目标时间 - uint32_t enter_age_time; //进入老化时间 - uint32_t age_time; //每轮老化结束时间 - - void aging_task(void) { errcode_t ret = 0; @@ -460,10 +452,21 @@ void factorytest_protocol_common_decode(uint8_t submode,uint8_t testitem,uint8_t uint16_t tp_id; uint32_t chip_id; //系统自检 + + bool state; + state = uapi_get_charger_plug_status(); + if (!state) + send_data[1] |= state << 0; + uapi_cywee_get_id(&id); if(id != 0x44) send_data[1] |= 1 << 1; + unsigned char mmc_id; + mmc5603_getid(&mmc_id); + if(mmc_id != 0x10) + send_data[1] |= 2 << 4; + touch_getid(&tp_id); PRINT("touch_getid : %2X \r\n",tp_id); if(tp_id != 0x6456) @@ -642,17 +645,6 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint &send_data, 1); } - if (testitem == 0x06) - { - uint8_t send_data = 0x00; - uapi_hfp_connect_(); - factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, - BLE_TEST_CMD_SOFT_TEST_SUB_MODE_BLE, - 0x06, - &send_data, - 1); - } - break; case BLE_TEST_CMD_SOFT_TEST_SUB_MODE_VIBRATOR: @@ -1796,6 +1788,17 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint &send_data, 1); } + if (testitem == 0x03) + { + uint8_t send_data = 0x00; + uapi_hfp_connect_(); + factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, + BLE_TEST_CMD_SOFT_TEST_SUB_MODE_SPEAKER, + 0x03, + &send_data, + 1); + } + //else if(testitem == 0x03) // { // //播放录音 diff --git a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp index bb60c5be1..1f1772616 100644 --- a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp @@ -602,6 +602,7 @@ void MsgCenterNotifyNextDayProc(const Topic topic, Request *req) { set_Is_shouw_falg(1,i); } + cywee_reset_history_daily_data(); //清除运动相关数据 do_cywee_service_check_msg(CYWEE_SERVICE_CMD_RESET_DAILY_DATA, NULL); /* ---------------------------------- 呼吸训练相关 ---------------------------------- */ RespiratoryTrainingModel::GetInstance().ClearTotalRespiratoryTrainingTime(); diff --git a/code/sdk/drivers/peripheral/cywee/Inc/cywee_hal.h b/code/sdk/drivers/peripheral/cywee/Inc/cywee_hal.h index 447c66d34..94baddf18 100644 --- a/code/sdk/drivers/peripheral/cywee/Inc/cywee_hal.h +++ b/code/sdk/drivers/peripheral/cywee/Inc/cywee_hal.h @@ -577,8 +577,7 @@ void cywee_save_sleep_stat_data(void); void cywee_custom_save_sleep_data(void); void cywee_custom_save_nap_data(void); - -extern uint8_t hrs_mode_state; +void cywee_reset_history_daily_data(void); #pragma pack() diff --git a/code/sdk/drivers/peripheral/cywee/src/main_dml.c b/code/sdk/drivers/peripheral/cywee/src/main_dml.c index c56f8f420..3bb51a27d 100644 --- a/code/sdk/drivers/peripheral/cywee/src/main_dml.c +++ b/code/sdk/drivers/peripheral/cywee/src/main_dml.c @@ -671,10 +671,12 @@ void cywee_hand_updown_switch(int cmd) CWM_Sensor_Disable(IDX_ALGO_WATCH_HANDUP); } -void cywee_reset_daily_data(void) +void cywee_reset_history_daily_data(void) { - memset(&scl, 0, sizeof(scl)); - CWM_SettingControl(SCL_RESET_DAILY_INFO, &scl); + stepcount=0; + new_distance=0; + new_fat=0; + new_calories=0; history_step = 0; history_calories=0; //卡路里数据 history_distances=0; //历史数据 @@ -682,6 +684,17 @@ void cywee_reset_daily_data(void) new_fat = 0; //当前燃脂数据 } +void cywee_reset_daily_data(void) +{ + memset(&scl, 0, sizeof(scl)); + CWM_SettingControl(SCL_RESET_DAILY_INFO, &scl); + // history_step = 0; + // history_calories=0; //卡路里数据 + // history_distances=0; //历史数据 + // history_fat=0; //历史燃脂数据 + // new_fat = 0; //当前燃脂数据 +} + //INT[1] : 0 立即输出,但不中止睡眠。 1 立即输出且中止睡眠 void cywee_get_sleep_data(int cmd) { @@ -1132,6 +1145,15 @@ void CWM_AP_SensorListen(pSensorEVT_t sensorEVT) { CWM_OS_dbgPrintf("IDX_ALGO_SHAKE\n"); break; case IDX_ALGO_INACTIVITY_OUTPUT: + if(uapi_dev_runtime_get_absolute_static_status()) //绝对静止 直接退出 + { + if((int)sensorEVT->fData[0] == 31 || (int)sensorEVT->fData[0] == 32) //最后一笔数据上报时 清除相应标志位 + { + uapi_dev_runtime_set_absolute_static_status(0); + } + break; + } + cywee_func = cywee_get_send_msg_callback_func(); CWM_OS_dbgPrintf("IDX_ALGO_INACTIVITY_OUTPUT\n"); if((int)sensorEVT->fData[0] == 20) @@ -1206,17 +1228,6 @@ void CWM_AP_SensorListen(pSensorEVT_t sensorEVT) { // cywee_func(CYWEE_MSG_TYPE_INACTIVITY_UPDATE,&c_inactivity_result_t,sizeof(cywee_inactivity_result_t)); }else if((int)sensorEVT->fData[0] == 31){ - - if(uapi_dev_runtime_get_absolute_static_status()) - { - uapi_dev_runtime_set_absolute_static_status(0);//清除绝对静止状态 - stat_num = 0; - memset(&sleep_stat,0,SLEEP_STATUS_LENGTH * sizeof(SLEEP_STAT_T)); - fall_asleep_timestamp = 0; - break ; //绝对静止状态不存数据 - } - - memset(&c_inactivity_accumulate_time_t,0,sizeof(cywee_inactivity_accumulate_time_t)); c_inactivity_accumulate_time_t.output_number = (int)sensorEVT->fData[0]; @@ -1696,6 +1707,14 @@ int cywee_main_dml(void) CWM_OS_dbgPrintf("DML device[%d]: hw_id=%d hw_attr=%d\n", i, scl.iData[6 + i * 2], scl.iData[7 + i * 2]); } +#if 0 + memset(&scl, 0, sizeof(scl)); + scl.iData[0] = 1; + scl.iData[3] = 9; + scl.iData[4] = 5; + scl.iData[7] = -1; + CWM_SettingControl(SCL_LOG, &scl); +#endif //设置抬腕功能 memset(&scl, 0, sizeof(scl)); scl.iData[0] = 1;