From ac4ebfca40ab816edd07583117fca8fef81ba029 Mon Sep 17 00:00:00 2001 From: yincheng.zhong <634916154@qq.com> Date: 星期四, 22 八月 2024 09:49:03 +0800 Subject: [PATCH] 4G 功能外包开发完成 --- keil/include/components/hal/UART.c | 25 +++++++------------------ 1 files changed, 7 insertions(+), 18 deletions(-) diff --git a/keil/include/components/hal/UART.c b/keil/include/components/hal/UART.c index afe11f7..beec20a 100644 --- a/keil/include/components/hal/UART.c +++ b/keil/include/components/hal/UART.c @@ -146,7 +146,7 @@ l_astUartInfo[_eUartID].m_mutexLock = osMutexCreate(HIDO_NULL); #endif -struct UART_CFG_T uart_cfg = + struct UART_CFG_T uart_cfg = { .parity = UART_PARITY_NONE, .stop = UART_STOP_BITS_1, @@ -337,25 +337,14 @@ *******************************************************************************/ static void uart_receive_callback(void *dev, uint32_t err_code) { - E_UartID eUartID = (E_UartID) 0; + E_UartID eUartID = UART_ID_4G; + + HIDO_UINT8 u8RecvByte = l_astUartInfo[eUartID].m_u8RxValue; - for (eUartID = (E_UartID) 0; eUartID < UART_ID_LAST; eUartID++) - { - if (l_astUartInfo[eUartID].m_eUartPort == *(enum UART_DEV_T *)dev) - { - if(UART_RX_MODE_INT == l_astUartInfo[eUartID].m_eRxMode) - { - HIDO_UINT8 u8RecvByte = l_astUartInfo[eUartID].m_u8RxValue; + HIDO_ArraryQueueIn(&l_astUartInfo[eUartID].m_stRxArraryQueue, &u8RecvByte); - HIDO_ArraryQueueIn(&l_astUartInfo[eUartID].m_stRxArraryQueue, &u8RecvByte); - - /* 启动INT接收 */ - uart_receive(l_astUartInfo[eUartID].m_eUartPort, &l_astUartInfo[eUartID].m_u8RxValue, 1, uart_receive_callback); - } - - break; - } - } + /* 启动INT接收 */ + uart_receive(l_astUartInfo[eUartID].m_eUartPort, &l_astUartInfo[eUartID].m_u8RxValue, 1, uart_receive_callback); } /******************************************************************************* -- Gitblit v1.9.3