You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That disabled piece of code was here before this commit, with the break which is needed (stop copying if rx buffer is full with no further changes in buffers). The issue was the missing USF(uart->uart_nr); just above it.
I then disabled this code because I though keeping recent data over old ones was preferred (@devyte does not fully agree with that). In that case we don't want the break.
The issue had to be fixed (because ISR stuck -> wdt) so I committed as-is with the possibility to revert this policy back by changing 0 to 1. This is illustrated in #4536.
Code has comments. Press enter to view.
126
+
#else
127
+
// discard oldest data
128
+
if (++uart->rx_buffer->rpos == uart->rx_buffer->size)
I think the final assignment here is an atomic instruction. However, the preceding if statement could potentially be a problem. I guess accessing the rxbuffer members outside the isr need to be guarded by turning off the uart interrupt. @igrr what is your take on this?
You are right, I guess uart_read_char() needs protection,
and since ->wpos is modified too in the ISR, all other access to uart->rx_buffer need review like the one proposed there.
0 commit comments