Hi,
I have a question for the CC1312 UART_read() function, if I get '-1' return, how do i clear it? I only read one character a time and if (-1) returns I try to read again but it will not clear the error.
thanks,
-Yue
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
I have a question for the CC1312 UART_read() function, if I get '-1' return, how do i clear it? I only read one character a time and if (-1) returns I try to read again but it will not clear the error.
thanks,
-Yue
Hi Yue,
I found this tidbit in UART.h:
* * The UART driver allows full duplex data transfers. Therefore, it is * possible to call UART_read() and UART_write() at the same time (for * either blocking or callback modes). It is not possible, however, * to issue multiple concurrent operations in the same direction. * For example, if one thread calls UART_read(uart0, buffer0...), * any other thread attempting UART_read(uart0, buffer1...) will result in * an error of UART_STATUS_ERROR, until all the data from the first UART_read() * has been transferred to buffer0. This applies to both blocking and * and callback modes. So applications must either synchronize * UART_read() (or UART_write()) calls that use the same UART handle, or * check for the UART_STATUS_ERROR return code indicating that a transfer is * still ongoing. *
I recommend familiarizing yourself with the UART driver documentation which can be found here: http://dev.ti.com/tirex/explore/node?node=AC8u7w1s19wuF9tmHrn.Vw__pTTHBmu__LATEST
Thanks,
Alexis