File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -860,15 +860,14 @@ impl<'a> UartRx<'a, Async> {
860860 // But if it is 0x3FF and buffer is not granted, this can mean we just finished transfer after
861861 // our grant check - so we skip this case to avoid overflowing written calculation below
862862 if xfercount == 0x3FF {
863- continue ;
864- }
865-
866- // Channel not active (transfer finished) and value is 0x3FF - nothing to transfer
867- let remaining = xfercount as usize + 1 ;
863+ available = 0 ;
864+ } else {
865+ let remaining = xfercount as usize + 1 ;
868866
869- let written = half_size - remaining;
870- if written > buffer_config. read_off {
871- available = written - buffer_config. read_off ;
867+ let written = half_size - remaining;
868+ if written > buffer_config. read_off {
869+ available = written - buffer_config. read_off ;
870+ }
872871 }
873872 }
874873 // If DMA is writing to the other buffer, no new data is available
You can’t perform that action at this time.
0 commit comments