Hi,
I am using PSP 1.10.03 UART driver to communication with Linux. My settings for UART is PSP_OPMODE_DMAINTERRUPT and synchronous communication. No change has done to UART driver at all.
Here is my communication protocol: first I read the header from UART0, and then find out how many bytes I need to read in the following.
Problem: when I find out the wrong header, I need to discard any remaining data in the read buffer so that it will be ready for next communication. I used following two statements to flush:
1. GIO_flush(Uart_fd); // This one don't flush the remaining data at all.
2. GIO_control(Uart_fd, PSP_UART_IOCTL_RESET_RX_FIFO, NULL);
// This one does flush the remaining received data. However, in next communication, somehow the first character of previous communication is always present before next data. I don't know why and where to change?
Can you help?
Thanks.
Alan