|
|
@ -346,7 +346,6 @@ extern "C" {
|
|
|
|
void UART0_IRQHandler (void)
|
|
|
|
void UART0_IRQHandler (void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
uint8_t IIRValue, LSRValue;
|
|
|
|
uint8_t IIRValue, LSRValue;
|
|
|
|
uint8_t Dummy = Dummy;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IIRValue = LPC_UART0->IIR;
|
|
|
|
IIRValue = LPC_UART0->IIR;
|
|
|
|
|
|
|
|
|
|
|
@ -361,7 +360,7 @@ void UART0_IRQHandler (void)
|
|
|
|
/* There are errors or break interrupt */
|
|
|
|
/* There are errors or break interrupt */
|
|
|
|
/* Read LSR will clear the interrupt */
|
|
|
|
/* Read LSR will clear the interrupt */
|
|
|
|
UART0Status = LSRValue;
|
|
|
|
UART0Status = LSRValue;
|
|
|
|
Dummy = LPC_UART0->RBR; /* Dummy read on RX to clear
|
|
|
|
dummy = LPC_UART0->RBR; /* Dummy read on RX to clear
|
|
|
|
interrupt, then bail out */
|
|
|
|
interrupt, then bail out */
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -375,7 +374,7 @@ void UART0_IRQHandler (void)
|
|
|
|
UART0RxQueueWritePos = (UART0RxQueueWritePos+1) % UARTRXQUEUESIZE;
|
|
|
|
UART0RxQueueWritePos = (UART0RxQueueWritePos+1) % UARTRXQUEUESIZE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
dummy = LPC_UART0->RBR;;
|
|
|
|
dummy = LPC_UART0->RBR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ( IIRValue == IIR_RDA ) /* Receive Data Available */
|
|
|
|
else if ( IIRValue == IIR_RDA ) /* Receive Data Available */
|
|
|
@ -387,7 +386,7 @@ void UART0_IRQHandler (void)
|
|
|
|
UART0RxQueueWritePos = (UART0RxQueueWritePos+1) % UARTRXQUEUESIZE;
|
|
|
|
UART0RxQueueWritePos = (UART0RxQueueWritePos+1) % UARTRXQUEUESIZE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
dummy = LPC_UART1->RBR;;
|
|
|
|
dummy = LPC_UART1->RBR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ( IIRValue == IIR_CTI ) /* Character timeout indicator */
|
|
|
|
else if ( IIRValue == IIR_CTI ) /* Character timeout indicator */
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -422,7 +421,6 @@ void UART0_IRQHandler (void)
|
|
|
|
void UART1_IRQHandler (void)
|
|
|
|
void UART1_IRQHandler (void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
uint8_t IIRValue, LSRValue;
|
|
|
|
uint8_t IIRValue, LSRValue;
|
|
|
|
uint8_t Dummy = Dummy;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IIRValue = LPC_UART1->IIR;
|
|
|
|
IIRValue = LPC_UART1->IIR;
|
|
|
|
|
|
|
|
|
|
|
@ -437,7 +435,7 @@ void UART1_IRQHandler (void)
|
|
|
|
/* There are errors or break interrupt */
|
|
|
|
/* There are errors or break interrupt */
|
|
|
|
/* Read LSR will clear the interrupt */
|
|
|
|
/* Read LSR will clear the interrupt */
|
|
|
|
UART1Status = LSRValue;
|
|
|
|
UART1Status = LSRValue;
|
|
|
|
Dummy = LPC_UART1->RBR; /* Dummy read on RX to clear
|
|
|
|
dummy = LPC_UART1->RBR; /* Dummy read on RX to clear
|
|
|
|
interrupt, then bail out */
|
|
|
|
interrupt, then bail out */
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -451,7 +449,7 @@ void UART1_IRQHandler (void)
|
|
|
|
UART1RxQueueWritePos =(UART1RxQueueWritePos+1) % UARTRXQUEUESIZE;
|
|
|
|
UART1RxQueueWritePos =(UART1RxQueueWritePos+1) % UARTRXQUEUESIZE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
dummy = LPC_UART1->RBR;;
|
|
|
|
dummy = LPC_UART1->RBR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ( IIRValue == IIR_RDA ) /* Receive Data Available */
|
|
|
|
else if ( IIRValue == IIR_RDA ) /* Receive Data Available */
|
|
|
@ -463,7 +461,7 @@ void UART1_IRQHandler (void)
|
|
|
|
UART1RxQueueWritePos = (UART1RxQueueWritePos+1) % UARTRXQUEUESIZE;
|
|
|
|
UART1RxQueueWritePos = (UART1RxQueueWritePos+1) % UARTRXQUEUESIZE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
dummy = LPC_UART1->RBR;;
|
|
|
|
dummy = LPC_UART1->RBR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ( IIRValue == IIR_CTI ) /* Character timeout indicator */
|
|
|
|
else if ( IIRValue == IIR_CTI ) /* Character timeout indicator */
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -484,7 +482,6 @@ void UART1_IRQHandler (void)
|
|
|
|
UART1TxEmpty = 0;
|
|
|
|
UART1TxEmpty = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/*****************************************************************************
|
|
|
|
/*****************************************************************************
|
|
|
|
** Function name: UART2_IRQHandler
|
|
|
|
** Function name: UART2_IRQHandler
|
|
|
@ -498,7 +495,6 @@ void UART1_IRQHandler (void)
|
|
|
|
void UART2_IRQHandler (void)
|
|
|
|
void UART2_IRQHandler (void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
uint8_t IIRValue, LSRValue;
|
|
|
|
uint8_t IIRValue, LSRValue;
|
|
|
|
uint8_t Dummy = Dummy;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IIRValue = LPC_UART2->IIR;
|
|
|
|
IIRValue = LPC_UART2->IIR;
|
|
|
|
|
|
|
|
|
|
|
@ -513,7 +509,7 @@ void UART2_IRQHandler (void)
|
|
|
|
/* There are errors or break interrupt */
|
|
|
|
/* There are errors or break interrupt */
|
|
|
|
/* Read LSR will clear the interrupt */
|
|
|
|
/* Read LSR will clear the interrupt */
|
|
|
|
UART2Status = LSRValue;
|
|
|
|
UART2Status = LSRValue;
|
|
|
|
Dummy = LPC_UART2->RBR; /* Dummy read on RX to clear
|
|
|
|
dummy = LPC_UART2->RBR; /* Dummy read on RX to clear
|
|
|
|
interrupt, then bail out */
|
|
|
|
interrupt, then bail out */
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -537,7 +533,7 @@ void UART2_IRQHandler (void)
|
|
|
|
UART2RxQueueWritePos = (UART2RxQueueWritePos+1) % UARTRXQUEUESIZE;
|
|
|
|
UART2RxQueueWritePos = (UART2RxQueueWritePos+1) % UARTRXQUEUESIZE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
dummy = LPC_UART2->RBR;;
|
|
|
|
dummy = LPC_UART2->RBR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ( IIRValue == IIR_CTI ) /* Character timeout indicator */
|
|
|
|
else if ( IIRValue == IIR_CTI ) /* Character timeout indicator */
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -571,7 +567,6 @@ void UART2_IRQHandler (void)
|
|
|
|
void UART3_IRQHandler (void)
|
|
|
|
void UART3_IRQHandler (void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
uint8_t IIRValue, LSRValue;
|
|
|
|
uint8_t IIRValue, LSRValue;
|
|
|
|
uint8_t Dummy = Dummy;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IIRValue = LPC_UART3->IIR;
|
|
|
|
IIRValue = LPC_UART3->IIR;
|
|
|
|
|
|
|
|
|
|
|
@ -586,7 +581,7 @@ void UART3_IRQHandler (void)
|
|
|
|
/* There are errors or break interrupt */
|
|
|
|
/* There are errors or break interrupt */
|
|
|
|
/* Read LSR will clear the interrupt */
|
|
|
|
/* Read LSR will clear the interrupt */
|
|
|
|
UART3Status = LSRValue;
|
|
|
|
UART3Status = LSRValue;
|
|
|
|
Dummy = LPC_UART3->RBR; /* Dummy read on RX to clear
|
|
|
|
dummy = LPC_UART3->RBR; /* Dummy read on RX to clear
|
|
|
|
interrupt, then bail out */
|
|
|
|
interrupt, then bail out */
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -610,7 +605,7 @@ void UART3_IRQHandler (void)
|
|
|
|
UART3RxQueueWritePos = (UART3RxQueueWritePos+1) % UARTRXQUEUESIZE;
|
|
|
|
UART3RxQueueWritePos = (UART3RxQueueWritePos+1) % UARTRXQUEUESIZE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
dummy = LPC_UART3->RBR;;
|
|
|
|
dummy = LPC_UART3->RBR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ( IIRValue == IIR_CTI ) /* Character timeout indicator */
|
|
|
|
else if ( IIRValue == IIR_CTI ) /* Character timeout indicator */
|
|
|
|
{
|
|
|
|
{
|
|
|
|