From e567fc4077b45b55e169600f541dd5d80f7304b2 Mon Sep 17 00:00:00 2001 From: SnickerSun Date: Tue, 19 Nov 2024 18:09:15 +0800 Subject: [PATCH] =?utf8?q?=E5=9C=A8=E8=B0=83=E8=AF=95=E7=AA=97=E5=8F=A3?= =?utf8?q?=EF=BC=8Cuart=E4=B8=B2=E5=8F=A3=E5=BC=80=E7=AE=A1=E7=90=86?= =?utf8?q?=EF=BC=8C=E5=85=B3=E9=97=AD=E4=B8=B2=E5=8F=A3=E5=8F=96=E6=B6=88d?= =?utf8?q?ebug=E6=8A=95=E7=A5=A8=EF=BC=8C=E4=BF=9D=E8=AF=81=E7=B3=BB?= =?utf8?q?=E7=BB=9F=E5=8F=AF=E4=BB=A5=E7=BB=A7=E7=BB=AD=E4=BC=91=E7=9C=A0?= =?utf8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../debug_output_notification.cpp | 1 + code/sdk/drivers/peripheral/utils/custom_utils.c | 10 +++++++++- code/sdk/drivers/peripheral/utils/custom_utils.h | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) 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" -- 2.17.1