Hi community !
I am using no RTOS and my goal is to simply be asynchronously notified when data is received. In the "old days" I would be notified by the UART INTerrupt and handle the data from there.
Now with the UART driver, do I have to poll with UART_read() ? I have tried to set the UART_Params to callback mode but it doesn't behave as I expect.
What's the trigger condition for the callback function to be called ?
This is the code I've added / modified from the uartecho example.
void sReadCallback(UART_Handle handle, void *buf, size_t count); uartParams.readCallback = &sReadCallback; uartParams.readMode = UART_MODE_CALLBACK; while (1) { // UART_read(uart, &input, 1); // UART_write(uart, &input, 1); } void sReadCallback(UART_Handle handle, void *buf, size_t count) { // Never comes here !!! UART_write(handle, buf, count); }
It should be easy enough, can someone show me the right way to do this before I spend more unnecessary time on this..
Thanks !