From: xue <2144439972@qq.com> Date: Fri, 13 Feb 2026 05:51:52 +0000 (+0800) Subject: 运动暂停表冠· X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F3216%2Ftarget%2F1;p=mirrors%2FFD230.git 运动暂停表冠· --- 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