From 70f1b42953a6994cf7d34d87937a09df20ff8946 Mon Sep 17 00:00:00 2001 From: penglei <1624952103@qq.com> Date: Sat, 5 Jul 2025 16:19:54 +0800 Subject: [PATCH] =?utf8?q?=E4=BC=98=E5=8C=964G=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../drivers/peripheral/utils/custom_utils.c | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.c b/code/sdk/drivers/peripheral/utils/custom_utils.c index 3fab3d019..bd367dbc8 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils.c @@ -1466,6 +1466,13 @@ void uapi_set4GCapability(bool isopen) { return; } + + uint8_t cnt = pm_veto_get_id_cnt(PM_ID_CAT1); + if (cnt == 0) + { + uapi_pm_add_sleep_veto(PM_ID_CAT1); + } + uapi_save_runtime_log(RUNTIME_LOG_CAT1_4G_OPEN); power_on_cat1(); // if(!uapi_dev_runtime_get_saveele_status()) @@ -1487,6 +1494,12 @@ void uapi_set4GCapability(bool isopen) } #endif + + cnt = pm_veto_get_id_cnt(PM_ID_CAT1); + if (cnt == 1) + { + uapi_pm_remove_sleep_veto(PM_ID_CAT1); + } } else { @@ -1503,12 +1516,6 @@ void uapi_set4GCapability(bool isopen) /*4G 开电有时有干扰进日志串口,因此关闭4G才开启日志串口*/ // uapi_custom_set_uart_rx_enable_flag(true); - uint8_t cnt = pm_veto_get_id_cnt(PM_ID_CAT1); - if (cnt == 1) - { - uapi_pm_remove_sleep_veto(PM_ID_CAT1); - } - #ifdef SUPPORT_TCPIP tcp_thread_id = tcp_get_thread_id(); if(tcp_thread_id != NULL) @@ -1520,6 +1527,13 @@ void uapi_set4GCapability(bool isopen) PRINT("tcpip_thread_suspend succed\n"); } #endif + + uint8_t cnt = pm_veto_get_id_cnt(PM_ID_CAT1); + if (cnt == 1) + { + uapi_pm_remove_sleep_veto(PM_ID_CAT1); + } + } } -- 2.17.1