From: penglei <1624952103@qq.com> Date: Sat, 5 Jul 2025 08:19:54 +0000 (+0800) Subject: 优化4G开关 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=70f1b42953a6994cf7d34d87937a09df20ff8946;p=mirrors%2FFD230.git 优化4G开关 --- 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); + } + } }