Ejemplo n.º 1
0
//*****************************************************************************
//
// The UART interrupt handler.
//
//*****************************************************************************
void UART1IntHandler(void)
{
    unsigned long ulStatus;
	tBoolean bRc;

    //
    // Get the interrrupt status.
    //
    ulStatus = UARTIntStatus(UART1_BASE, true);
    //
    // Clear the asserted interrupts.
    //
    UARTIntClear(UART1_BASE, ulStatus);

	//
	// Check what is the source of the interrupt
	//

	//if(ulStatus & UART_INT_OE)
	//{
	//}
	//else if(ulStatus & UART_INT_BE)
	//{
	//}
	//else if(ulStatus & UART_INT_PE)
	//{
	//}
	if(ulStatus & UART_INT_TX)
	{
		// TX int
		// Push next char to transmitter
		bRc = true;
		while(m_nTxBuffIn1 > 0 && bRc == true)
		{
			bRc = UARTCharPutNonBlocking(UART1_BASE,m_tTxBuff1[m_nTxNextNdx1]);
 			if(bRc == true)
			{
				m_nTxNextNdx1++;
				m_nTxBuffIn1--;
			}
		}
	}
	else if(ulStatus & UART_INT_RX || ulStatus & UART_INT_RT)
	{
		// RX int
		// Read all RX fifo data
		while(UARTCharsAvail(UART1_BASE))
		{
			// Read the next character from the UART
			// (and write it back to the UART) ?
			//MessageLoop(UART0_BASE,0);
			OmapMessageLoop(UART1_BASE,1);						
		}
	}
}
Ejemplo n.º 2
0
void UART1IntHandler()
{
    unsigned long ulStatus;

    //
    // Get the interrrupt status.
    //
    ulStatus = UARTIntStatus(UART1_BASE, true);
    //
    // Clear the asserted interrupts.
    //
    UARTIntClear(UART1_BASE, ulStatus);

    if(ulStatus & UART_INT_TX)
    {
     // TX int
     // Push next char to transmitter
     bRc = true;
     while((m_nTxBuffIn1 > 0) && (bRc == true) && UARTSpaceAvail(UART1_BASE))
     {
               //
               // Write the next character into the transmit FIFO.
               //
      bRc = UARTCharPutNonBlocking(UART1_BASE,m_tTxBuff1[m_nTxNextNdx1]);
       if(bRc == true)
      {
       m_nTxNextNdx1++;
       m_nTxBuffIn1--;
      }
     }

    }
    else if(ulStatus & UART_INT_RX || ulStatus & UART_INT_RT)
    {
     // RX int
     // Read all RX fifo data
     while(UARTCharsAvail(UART1_BASE))
     {
      // Read the next character from the UART
      // (and write it back to the UART) ?
      OmapMessageLoop(UART1_BASE,1);
     }
    }

}