arunkollam
Junior Member level 2
Can any one have an idea in building a function which will wait only for 10 ms after that it jumps from the loop and clear the previous data s stored in both uarts (UART0 AND UART1).My intention is that UART 1 will not wait for the remaining characters,after a particular time.The UART is waiting inside the loop for the remaining characters which never occur. so i need to flush the previously stored characters in the buffers(UART1 & 2) and need to start the program by accepting new character from UART0.
Code:
int UART0_getchar (void) {
while (!(LPC_UART0->LSR & 0x01))
{
}
}
return (LPC_UART0->RBR);
int UART1_getchar (void)
{
while (!(LPC_UART1->LSR & 0x01))
{
}
return (LPC_UART1->RBR);
}