| | |
| | | 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) |
| | | { |
| | |
| | | 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; |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /******************************************************************************* |
| | | * 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 : |