From 4be9f00578cbfd72ea94f56c7353a2d3ce92ec77 Mon Sep 17 00:00:00 2001 From: WXK <287788329@qq.com> Date: 星期四, 27 三月 2025 18:03:25 +0800 Subject: [PATCH] ota升级开发完成 --- keil/include/components/hal/UART.c | 33 ++++++++++++++++++++++++++++----- 1 files changed, 28 insertions(+), 5 deletions(-) diff --git a/keil/include/components/hal/UART.c b/keil/include/components/hal/UART.c index 4839aaf..b409785 100644 --- a/keil/include/components/hal/UART.c +++ b/keil/include/components/hal/UART.c @@ -168,8 +168,12 @@ l_astUartInfo[_eUartID].m_u32RxBufSize = _pstInit->m_u32RxBufSize; if(UART_RX_MODE_DMA == _pstInit->m_eRxMode) { - l_astUartInfo[_eUartID].m_pu8RxLastPos= l_astUartInfo[_eUartID].m_pu8RxBuf; - l_astUartInfo[_eUartID].m_pu8RxBufEnd = l_astUartInfo[_eUartID].m_pu8RxBuf + l_astUartInfo[_eUartID].m_u32RxBufSize - 1; + HIDO_ArraryQueueInit( + &l_astUartInfo[_eUartID].m_stRxArraryQueue, + _pstInit->m_pu8RxBuf, + _pstInit->m_u32RxBufSize, + sizeof(HIDO_UINT8)); + return HIDO_OK; } else if(UART_RX_MODE_INT == _pstInit->m_eRxMode) { @@ -369,11 +373,16 @@ osMutexWait(l_astUartInfo[_eUartID].m_mutexLock, osWaitForever); #endif - if (UART_RX_MODE_INT == l_astUartInfo[_eUartID].m_eRxMode) + switch(l_astUartInfo[_eUartID].m_eRxMode) { - if (HIDO_ArraryQueueOut(&l_astUartInfo[_eUartID].m_stRxArraryQueue, _pu8Char) == HIDO_OK) + case UART_RX_MODE_INT: + case UART_RX_MODE_DMA: { - i32Result = HIDO_OK; + if (HIDO_ArraryQueueOut(&l_astUartInfo[_eUartID].m_stRxArraryQueue, _pu8Char) == HIDO_OK) + { + i32Result = HIDO_OK; + } + break; } } @@ -385,6 +394,20 @@ } /******************************************************************************* + * Function Name : Uart_SetChar + * Description : + * Input : + * Output : + * Return : + * Author : 杜键 + * Modified Date: : 2018年4月24日 + *******************************************************************************/ +HIDO_VOID Uart_SetChar(E_UartID _eUartID, HIDO_UINT8 _u8Data) +{ + HIDO_ArraryQueueIn(&l_astUartInfo[_eUartID].m_stRxArraryQueue, &_u8Data); +} + +/******************************************************************************* * Function Name : * Description : * Input : -- Gitblit v1.9.3