实时更新活动目标 3204/1 3204/head 3205/target/1 3206/target/1
authorxue <2144439972@qq.com>
Sat, 7 Feb 2026 08:53:56 +0000 (16:53 +0800)
committerxue <2144439972@qq.com>
Sat, 7 Feb 2026 08:53:56 +0000 (16:53 +0800)
code/sdk/zhihui/services/ble_service/blemoder/ble_congfig_adapt.cpp

index f850be0..125b265 100644 (file)
@@ -93,6 +93,13 @@ void get_sedent_param_(msg_sedent_set_param_info_t * data)
     return;
 }
 
+/** 将 v 限制在 [lo, hi] 范围内(无符号) */
+static inline uint32_t clamp_u32(uint32_t v, uint32_t lo, uint32_t hi)
+{
+    if (v < lo) return lo;
+    if (v > hi) return hi;
+    return v;
+}
 
 /* 睡眠时间校验:hour 0~23,min 0~59;异常使用默认 就寝20:00 起床09:00 */
 #define SLEEP_HOUR_MAX   23
@@ -388,13 +395,7 @@ int get_quick_auxiliary_paramters_(void)
     return p_ConfigModel->get_configData_int(OHOS::ConfigModel::CONFIGMODEL_ITEM_QUICK_AUXILIARY_PARAMETERS);
 } 
 
-/** 将 v 限制在 [lo, hi] 范围内(无符号) */
-static inline uint32_t clamp_u32(uint32_t v, uint32_t lo, uint32_t hi)
-{
-    if (v < lo) return lo;
-    if (v > hi) return hi;
-    return v;
-}
+
 
 /** 设置运动目标步数;超范围自动裁剪并打 log */
 void set_goal_stepcount_(uint32_t step)
@@ -405,6 +406,7 @@ void set_goal_stepcount_(uint32_t step)
     }
     OHOS::ConfigModel::GetInstance()->set_condigData_Int(
         OHOS::ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STEPCOUNT,         (int)v);
+        SendMsgToUIService(UI_UPDATE_GOAL, 0, nullptr, 0);
 }
 
 /** 设置运动目标卡路里;超范围自动裁剪并打 log */
@@ -416,6 +418,7 @@ void set_goal_caloriescount_(uint32_t kcal)
     }
     OHOS::ConfigModel::GetInstance()->set_condigData_Int(
         OHOS::ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_CALORIES,         (int)v);
+    SendMsgToUIService(UI_UPDATE_GOAL, 0, nullptr, 0);
 }
 
 /** 设置消息通知总开关(on:true 开,false 关) */