Closed
Description
Description
- Type: Enhancement
- Related issue: There is no tests to verify that UART TX is complete #1849
- Priority: Minor
Enhancement
Reason to enhance or problem with existing solution
When using the Serial API, most implementations take the to-be-transmitted data and place it in the UART hardware's FIFO. At this point the function returns, however there is no way to actually check via the mbed API whether this data has actually been transmitted "on the wire".
Suggested enhancement
It has been suggested in past discussions (#1849, #3132, #2966) to add a C HAL function that would allow applications to check if the FIFO buffer is empty. This would allow applications to ensure all data has been transmitted before doing certain actions that affect the serial hardware (eg. sleep/deepsleep).
Pros
- Allows applications to delay until all data has been transmitted before moving on to other tasks.
Cons
- Time intensive task of ensure all targets implement this function
- Not all targets may support this functionality