From fba141a58d5acf1f7c07be64de3bf6cbd80be898 Mon Sep 17 00:00:00 2001 From: penglei <1624952103@qq.com> Date: Fri, 21 Jun 2024 14:03:58 +0800 Subject: [PATCH] =?utf8?q?=E4=BC=98=E5=8C=96=E8=BF=90=E5=8A=A8=E5=BF=83?= =?utf8?q?=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeapp/nativeui/activity/src/ActivityModel.cpp | 3 ++- code/sdk/drivers/peripheral/cywee/Inc/cywee_hal.h | 1 - code/sdk/drivers/peripheral/cywee/Inc/cywee_service.h | 8 ++------ .../drivers/peripheral/cywee/service/cywee_service.c | 8 -------- code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c | 11 +++++++---- .../drivers/peripheral/ppg/service/ppg_service.cpp | 3 +-- 6 files changed, 12 insertions(+), 22 deletions(-) diff --git a/code/sdk/application/wearable/nativeapp/nativeui/activity/src/ActivityModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/activity/src/ActivityModel.cpp index 61cc52b76..907e2e8c4 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/activity/src/ActivityModel.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/activity/src/ActivityModel.cpp @@ -119,7 +119,8 @@ static void Notify(void *args, const Topic topic, Request* request) } // 计步数据累加 uint32 counter = OHOS::ActivityModel::GetInstance()->GetStepCounter(); - counter += *(uint32_t *)request->data; + //counter += *(uint32_t *)request->data; + counter = *(uint32_t *)request->data; OHOS::ActivityModel::GetInstance()->ReviseStepCounter(counter); GraphicService::GetInstance()->PostGraphicEvent( diff --git a/code/sdk/drivers/peripheral/cywee/Inc/cywee_hal.h b/code/sdk/drivers/peripheral/cywee/Inc/cywee_hal.h index 89e489ef5..25c83e2a9 100644 --- a/code/sdk/drivers/peripheral/cywee/Inc/cywee_hal.h +++ b/code/sdk/drivers/peripheral/cywee/Inc/cywee_hal.h @@ -528,7 +528,6 @@ void set_distance_data(uint32_t data); int get_distance_data(void ); void cywee_get_chipinfo(char *databuf,uint8_t len); -void cywee_get_acc_switch(uint8_t cmd); void cywee_set_sedentary_interval(int time); extern uint8_t hrs_mode_state; diff --git a/code/sdk/drivers/peripheral/cywee/Inc/cywee_service.h b/code/sdk/drivers/peripheral/cywee/Inc/cywee_service.h index 583084a51..d38359024 100644 --- a/code/sdk/drivers/peripheral/cywee/Inc/cywee_service.h +++ b/code/sdk/drivers/peripheral/cywee/Inc/cywee_service.h @@ -2,7 +2,7 @@ * @Author: penglei 1624952103@qq.com * @Date: 2024-03-26 20:29:58 * @LastEditors: penglei 1624952103@qq.com - * @LastEditTime: 2024-05-10 12:22:41 + * @LastEditTime: 2024-06-21 09:33:30 * @FilePath: /FD230/code/sdk/drivers/peripheral/cywee/Inc/cywee_service.h * @Description: * @@ -78,11 +78,7 @@ extern "C" { #define CYWEE_SERVICE_CMD_SAVE_DATA 0x2C -#define CYWEE_SERVICE_CMD_START_GET_ACC 0x2D - -#define CYWEE_SERVICE_CMD_STOP_GET_ACC 0x2E - -#define CYWEE_SERVICE_CMD_SET_SEDENTARY_INTERVAL 0x2F +#define CYWEE_SERVICE_CMD_SET_SEDENTARY_INTERVAL 0x2D errcode_t uapi_cywee_service_init(void); void uapi_cywee_service_deinit(void); diff --git a/code/sdk/drivers/peripheral/cywee/service/cywee_service.c b/code/sdk/drivers/peripheral/cywee/service/cywee_service.c index 32af17bfb..eb369965e 100644 --- a/code/sdk/drivers/peripheral/cywee/service/cywee_service.c +++ b/code/sdk/drivers/peripheral/cywee/service/cywee_service.c @@ -380,14 +380,6 @@ static void cywee_service_check_task(void const *arg) cywee_save_data(); break; - case CYWEE_SERVICE_CMD_START_GET_ACC: - cywee_get_acc_switch(1); - break; - - case CYWEE_SERVICE_CMD_STOP_GET_ACC: - cywee_get_acc_switch(0); - break; - case CYWEE_SERVICE_CMD_SET_SEDENTARY_INTERVAL: cywee_set_sedentary_interval(mail.data[0]); break; diff --git a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c index 8475fe746..16ab39143 100644 --- a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c +++ b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c @@ -2752,10 +2752,13 @@ void hx3695_hrs_ppg_Int_handle(void) PRINT("*count : %d \r\n",*count); if(*count < 10) { - if(hrs_mode_state == 1) - { - gsensor_get_n_data(8,gsensordata); - } + memset(gsensordata,0.0f,sizeof(gsenson_t) * 8); + + if(hrs_mode_state == 1) + { + gsensor_get_n_data(8,gsensordata); + } + for(ii=0; ii<*count; ii++) { if(ii == 8) diff --git a/code/sdk/drivers/peripheral/ppg/service/ppg_service.cpp b/code/sdk/drivers/peripheral/ppg/service/ppg_service.cpp index 56d494a7b..d2d1b910e 100644 --- a/code/sdk/drivers/peripheral/ppg/service/ppg_service.cpp +++ b/code/sdk/drivers/peripheral/ppg/service/ppg_service.cpp @@ -309,7 +309,7 @@ static void ppg_service_check_task(void *arg) wear_mode_timeout_handler(NULL); continue; }else if (mail == PPG_SERVICE_CMD_TYPE_DO_PPG_TEST){ - do_cywee_service_check_msg(CYWEE_SERVICE_CMD_START_GET_ACC,NULL); + cmd = "hrs"; enable = 1; uapi_pm_add_sleep_veto(PM_ID_HEART); @@ -342,7 +342,6 @@ static void ppg_service_check_task(void *arg) enable = 0; wear_mode_state = 0; }else if (mail == PPG_SERVICE_CMD_TYPE_STOP_PPG_TEST){ - do_cywee_service_check_msg(CYWEE_SERVICE_CMD_STOP_GET_ACC,NULL); cmd = "hrs"; enable = 0; uapi_pm_remove_sleep_veto(PM_ID_HEART); -- 2.17.1