From: xue <2144439972@qq.com> Date: Sat, 7 Feb 2026 08:53:56 +0000 (+0800) Subject: 实时更新活动目标 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F3204%2F1;p=mirrors%2FFD230.git 实时更新活动目标 --- diff --git a/code/sdk/zhihui/services/ble_service/blemoder/ble_congfig_adapt.cpp b/code/sdk/zhihui/services/ble_service/blemoder/ble_congfig_adapt.cpp index f850be069..125b26556 100644 --- a/code/sdk/zhihui/services/ble_service/blemoder/ble_congfig_adapt.cpp +++ b/code/sdk/zhihui/services/ble_service/blemoder/ble_congfig_adapt.cpp @@ -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 关) */