在调试窗口,uart串口开管理,关闭串口取消debug投票,保证系统可以继续休眠。 1425/1 1425/head
authorSnickerSun <snickersun@163.com>
Tue, 19 Nov 2024 10:09:15 +0000 (18:09 +0800)
committerSnickerSun <snickersun@163.com>
Tue, 19 Nov 2024 10:09:15 +0000 (18:09 +0800)
code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp
code/sdk/drivers/peripheral/utils/custom_utils.c
code/sdk/drivers/peripheral/utils/custom_utils.h

index 1447a51..78d7eaf 100644 (file)
@@ -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 {
index 2f64b0a..443ee3f 100644 (file)
@@ -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);
+    } 
+}
index e84ada1..1bfa2ac 100644 (file)
@@ -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"