From: SnickerSun Date: Wed, 20 Mar 2024 11:04:07 +0000 (+0800) Subject: 优化cat1代码,cat1电源关闭时,跳过指令下达 X-Git-Tag: release_V1.2.70_20241020_135402~1287 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=208c999ac91dd0e418dea5b58cc77eb156a18b2b;p=mirrors%2FFD230.git 优化cat1代码,cat1电源关闭时,跳过指令下达 --- diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.cpp b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.cpp index 838d0d87f..83eb444d3 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.cpp +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.cpp @@ -60,6 +60,13 @@ uint32_t uapi_cat1_reset(uint32_t pwron) return 0; } + +bool uapi_cat1_get_power_stat(void) +{ + + return ( GPIO_LEVEL_HIGH == uapi_gpio_get_output_val(S_AGPIO_L23)); + +} void uapi_cat1_start_volte_voice(void) { char *argv[]={"start"}; diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.h b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.h index 36efbfec2..bb06366b6 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.h +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.h @@ -18,6 +18,7 @@ void uapi_cat1_stop_volte_voice(void); void uapi_cat1_remove_audio_vote(void); void uapi_cat1_add_audio_vote(void); void uapi_cat1_wakeup_cat1(uint8_t wakeup); +bool uapi_cat1_get_power_stat(void); #ifdef __cplusplus #if __cplusplus diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp index 3e27dc358..6a94c08a3 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp @@ -152,6 +152,12 @@ static void udp_send_response(char *tx_buffer, char *head, char *content) #include "uart_porting.h" void udp_send_msg_toCat1(char cmd,char *content) { + + if (!uapi_cat1_get_power_stat()) + { + printf("Error cat1 poweroff skipp send data\n"); + return ; + } uapi_cat1_wakeup_cat1(1); // uart_port_register_irq(UART_BUS_0);