send UART_BUFFER_FULL to uart event queue front (IDFGH-11254) #12413
+6
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
UART_BUFFER_FULL should be sent to event queue front to signal that ring buffer is full when it happens. If it is sent to queue back, by the time it is received on another task, it might not be relevant anymore. If UART_DATA events predate UART_BUFFER_FULL, ring buffer was full, but it is not anymore.
Example ring buffer size 1k (8 * UART_FULL_THRESH_DEFAULT):
ISR(send) -> FDDDDDDDD -> task(receive)
Task could receive eight UART_DATA events and read data from ring buffer before it could be informed that ring buffer was full and some data might got lost. If UART_BUFFER_FULL is sent to queue front (DDDDDDDDF), user task can read all data from ring buffer and then clean event buffer because UART_DATA events aren't needed anymore.