AnsweredAssumed Answered

fsl_flexio_uart.c change proposal

Question asked by michals on Aug 13, 2018
Latest reply on Aug 15, 2018 by Hui_Ma

I propose to add the following code to FLEXIO_UART_TransferReceiveNonBlocking() function in fsl_flexio_uart.c (Kinetis SDK). This will make sure that callback function is called in all cases when requested data is received. It makes the code that uses the driver easier to implement. Similar code appears to be already supported/present in fsl_uart.c driver but not in fsl_flexio_uart.c version. 


Here is the diff for fsl_felxio_uart.c


/* Enable FLEXIO_UART RX IRQ if previously enabled. */
FLEXIO_UART_EnableInterrupts(base, kFLEXIO_UART_RxDataRegFullInterruptEnable);

+/* Call user callback since all data are received. */
+if (0 == bytesToReceive)
+if (handle->callback)
+handle->callback(base, handle, kStatus_FLEXIO_UART_RxIdle, handle->userData);
/* Ring buffer not used. */