2010-02-06 08:03 PM
two usart problem
#usart_getitstatus-usart2-interrupt-usart_receivedata2011-05-17 04:39 AM
And my interrupt service routine looks like this...
(fifo2 is a circular queue class I wrote, and xUartMgrHandle is a struct to hold the I/O queues)
I'm not sure whether the ORE clear call is strictly necessary.
void uartmgrISR(xUartMgrHandle m)
{
if(USART_GetITStatus(m->usart, USART_IT_RXNE) != 0)
{
fifo2_put(m->recieveFifo, USART_ReceiveData(m->usart));
}
/* If Overrun occures, clear the OVR condition */
if (USART_GetFlagStatus(m->usart, USART_FLAG_ORE) != RESET)
{
(void)USART_ReceiveData(m->usart);
USART_ClearITPendingBit (m->usart, USART_IT_ORE);
}