cancel
Showing results for 
Search instead for 
Did you mean: 

two usart problem

younhun
Associate
Posted on February 07, 2010 at 05:03

two usart problem

#usart_getitstatus-usart2-interrupt-usart_receivedata
10 REPLIES 10
rkeene
Associate II
Posted on May 17, 2011 at 13:39

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);

  }