From: Caisking <3449750381@qq.com> Date: Mon, 30 Dec 2024 07:14:56 +0000 (+0800) Subject: 心率:增加心率传感器的开启与关闭的错误记录 X-Git-Tag: v1.3.113-repair_tp~55 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=22c029018ddeb4b58a7bd6c8b48fa1ecdd6bff51;p=mirrors%2FFD230.git 心率:增加心率传感器的开启与关闭的错误记录 --- diff --git a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695_factory_test.h b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695_factory_test.h index 7abd190f5..aadb903af 100644 --- a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695_factory_test.h +++ b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695_factory_test.h @@ -37,7 +37,7 @@ FT_RESULTS_t hx3695_factroy_test(TEST_MODE_t test_mode); void hx3695_lab_test(uint32_t test_mode); void hx3695_lab_test_read(void); - +bool hx3695_chip_check_id(void); #endif // _HX3695_FACTORY_TEST_H_ diff --git a/code/sdk/drivers/peripheral/ppg/service/ppg_service.cpp b/code/sdk/drivers/peripheral/ppg/service/ppg_service.cpp index 508e25926..f5014efeb 100644 --- a/code/sdk/drivers/peripheral/ppg/service/ppg_service.cpp +++ b/code/sdk/drivers/peripheral/ppg/service/ppg_service.cpp @@ -49,6 +49,7 @@ extern "C" { #include "cywee_service.h" #include "custom_runtime.h" #include "custom_save_runtime.h" +#include "hx3695_factory_test.h" static bool g_ppg_service_initialled = false; @@ -238,15 +239,19 @@ uint32_t ppg_resume(void) errcode_t send_ppg_cmd_msg(int cmd) { errcode_t ret; - if (ppg_sensor_exist == false) + if (ppg_sensor_exist == false) { + uapi_save_runtime_log(RUNTIME_LOG_HEART_EXIST_ERROR); return OSAL_FAILURE; + } PPG_CMD_TYPE_T mail = 0; mail = cmd; ret = osal_msg_queue_write_copy(g_app_queue, (void *)&mail, sizeof(PPG_CMD_TYPE_T), 0); if (ret != OSAL_SUCCESS) { - PRINT_ERR("Error ppg Check MSG 0x%02X send failed! err=0x%x! \r\n",cmd, ret); + PRINT_ERR("Error ppg Check MSG 0x%02X send failed! err=0x%x! \r\n", cmd, + ret); + uapi_save_runtime_log(RUNTIME_LOG_HEART_MSG_ERROR); } return ret; } @@ -393,7 +398,7 @@ errcode_t uapi_ppg_service_init(void) #ifdef PPG_HX3695 tyhx_poweron(); - if ( hx3695_chip_check() == false) + if ( hx3695_chip_check_id() == false) { //TODO 没找到3695,退出线程 PRINT("3695 not exist!\r\n"); diff --git a/code/sdk/drivers/peripheral/utils/custom_save_runtime.h b/code/sdk/drivers/peripheral/utils/custom_save_runtime.h index d9f897b0b..cdd070820 100644 --- a/code/sdk/drivers/peripheral/utils/custom_save_runtime.h +++ b/code/sdk/drivers/peripheral/utils/custom_save_runtime.h @@ -152,6 +152,10 @@ extern "C" RUNTIME_LOG_HEART_VALID_VALUE, //获取到1个未佩戴值 RUNTIME_LOG_HEART_NOT_WEAR, + //心率msg接收失败 + RUNTIME_LOG_HEART_MSG_ERROR, + //心率sensor不存在 + RUNTIME_LOG_HEART_EXIST_ERROR, /*******************************/ // 佩戴