Microcontroller : TM4C1294NCPDT
I am currently working on a small application that prompts the user to enter character serially, by using UART_read and displaying the information depending on the character entered serially.
But currently I am now in a requirement, where the UART_read function has to skip, if no character is entered and execute the existing function.
These are the current approaches that I have tried out.
Approach 1
uartparams.readTimeout = 2000// 2seconds
Description: Added a params.readTimeout instruction.
Result: IThe existing function is not executing continuously as , the function is still in the UART_read function
Approach 2
int char_count;
char count = UART_read(uart,&mychar,1);
do
{
myfunction;
}while(count == 0);
if(my_char == 'n')
{
break;
}
Descriptiion: Here also it is stopping at UART_read function.
Note: I have declared params.readTimeout= BIOS_WAIT_FOREVER in the beginning and giving a 2 seconds timeout in this function.
Kindly help me out.