运动暂停表冠· 3215/1 3215/head 3216/target/1
authorxue <2144439972@qq.com>
Fri, 13 Feb 2026 05:51:52 +0000 (13:51 +0800)
committerxue <2144439972@qq.com>
Fri, 13 Feb 2026 05:51:52 +0000 (13:51 +0800)
code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/src/TraingModel.cpp
code/sdk/zhihui/drivers/rotary_encoder/hx3508/hx3508_hal.h

index 4890703..2068f7b 100644 (file)
  #include <service/graphic_service.h>
  #include <sstream>
  #include <string>
+
+ #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, "结束运动");
    }
  }
index cd96b71..b11e804 100644 (file)
@@ -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