From 21ee0c882d395e94054cf52212ce65b45fa1dfaa Mon Sep 17 00:00:00 2001 From: xue <2144439972@qq.com> Date: Fri, 13 Feb 2026 13:51:52 +0800 Subject: [PATCH] =?utf8?q?=E8=BF=90=E5=8A=A8=E6=9A=82=E5=81=9C=E8=A1=A8?= =?utf8?q?=E5=86=A0=C2=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeapp/nativeui/traing/src/TraingModel.cpp | 14 ++++++++++++-- .../drivers/rotary_encoder/hx3508/hx3508_hal.h | 2 ++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/src/TraingModel.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/src/TraingModel.cpp index 4890703c4..2068f7b97 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/src/TraingModel.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/src/TraingModel.cpp @@ -21,6 +21,10 @@ #include #include #include + + #ifdef ROTARYENCODER_HX3508 + #include "hx3508_hal.h" + #endif #include "ConfigModel.h" @@ -797,7 +801,10 @@ void TraingModel::SetSportdata(SportData *data) { sport_start_data_timer(300); //开启数据获取定时器 刷新频率是300ms - +#ifdef ROTARYENCODER_HX3508 + // 停止旋转编码器 + hx3508_stop(); + #endif #ifdef SYSTEM_LOG_SERVICE //日志记录 if (Openingway) { @@ -861,7 +868,10 @@ void TraingModel::SetSportdata(SportData *data) { else { sendtraningstatedata(0, sportdata->duration); } - + #ifdef ROTARYENCODER_HX3508 + // 开启旋转编码器 + hx3508_start(); + #endif WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "结束运动"); } } diff --git a/code/sdk/zhihui/drivers/rotary_encoder/hx3508/hx3508_hal.h b/code/sdk/zhihui/drivers/rotary_encoder/hx3508/hx3508_hal.h index cd96b71f8..b11e80465 100644 --- a/code/sdk/zhihui/drivers/rotary_encoder/hx3508/hx3508_hal.h +++ b/code/sdk/zhihui/drivers/rotary_encoder/hx3508/hx3508_hal.h @@ -31,6 +31,8 @@ extern "C" { void *rotary_encoder_get_hx3508_api(void); void *rotary_encoder_get_hx3508_peri_attr(void); void hx3508_get_chip_id(uint16_t *id); +uint32_t hx3508_start(void); +uint32_t hx3508_stop(void); #ifdef __cplusplus #if __cplusplus -- 2.17.1