From: snickersun@163.com Date: Tue, 19 Nov 2024 12:00:17 +0000 (+0000) Subject: Merge #1425 into sdk602patch0911 from refs/changes/1425/head X-Git-Tag: fd230_release_V1.3.102~59^2~2 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=339a4e951210c54710def112df8baec0aae88f38;p=mirrors%2FFD230.git Merge #1425 into sdk602patch0911 from refs/changes/1425/head 在调试窗口,uart串口开管理,关闭串口取消debug投票,保证系统可以继续休眠。 * refs/changes/1425/head: (1 commits squashed) - 在调试窗口,uart串口开管理,关闭串口取消debug投票,保证系统可以继续休眠。 Signed-off-by: snickersun@163.com Reviewed-by: Caisking <3449750381@qq.com> Reviewed-by: 罗正 <1732036298@qq.com> Reviewed-by: aliyun8003852482 <1224667075@qq.com> Reviewed-by: snickersun@163.com Reviewed-by: aliyun6865282430 <1624952103@qq.com> Merged-by: snickersun@163.com CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/1425 --- diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp index 1447a5192..78d7eaf56 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp @@ -699,6 +699,7 @@ namespace OHOS if (toggleButton->GetState() == false) { // toggleButton->SetState(false); SystemLogModel::GetInstance()->set_uart_status(false); + remove_debug_vote(); //关闭uart的同时也取消 debug的投票,保证关闭开关后可以正常休眠 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"uart_at_set false"); } else { diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.c b/code/sdk/drivers/peripheral/utils/custom_utils.c index b931a387b..7d2ae55bd 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils.c @@ -3961,4 +3961,12 @@ errcode_t enable_offline_log_nv(uint8_t log_enable) return ERRCODE_SUCC; -} \ No newline at end of file +} + +void remove_debug_vote(void) +{ + uint8_t cnt = pm_veto_get_id_cnt(PM_ID_DEBUG); + if (cnt == 1) { + uapi_pm_remove_sleep_veto(PM_ID_DEBUG); + } +} diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.h b/code/sdk/drivers/peripheral/utils/custom_utils.h index e84ada1f4..1bfa2acc8 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.h +++ b/code/sdk/drivers/peripheral/utils/custom_utils.h @@ -419,6 +419,8 @@ uint8_t get_offline_log_nv(void); */ errcode_t enable_offline_log_nv(uint8_t log_enable); +void remove_debug_vote(void); + #include "custom_utilscpp.h"