From 44a727f804c79f07c45d439ac076476178631118 Mon Sep 17 00:00:00 2001 From: xue <2144439972@qq.com> Date: Sat, 7 Feb 2026 16:53:56 +0800 Subject: [PATCH] =?utf8?q?=E5=AE=9E=E6=97=B6=E6=9B=B4=E6=96=B0=E6=B4=BB?= =?utf8?q?=E5=8A=A8=E7=9B=AE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../ble_service/blemoder/ble_congfig_adapt.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) 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 关) */ -- 2.17.1