From: SnickerSun Date: Tue, 19 Nov 2024 10:09:15 +0000 (+0800) Subject: 在调试窗口,uart串口开管理,关闭串口取消debug投票,保证系统可以继续休眠。 X-Git-Tag: fd230_release_V1.3.102~56^2~3 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F1425%2F1;p=mirrors%2FFD230.git 在调试窗口,uart串口开管理,关闭串口取消debug投票,保证系统可以继续休眠。 --- 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 2f64b0a90..443ee3faa 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils.c @@ -3958,4 +3958,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"