Fix UART wrong ::available() during wraparound (#739)
Fixes #735 . Thanks to @ Haggarman for the find and fix.
This commit is contained in:
parent
005cba3acd
commit
cabb06d495
1 changed files with 1 additions and 1 deletions
|
|
@ -292,7 +292,7 @@ int SerialUART::available() {
|
|||
} else {
|
||||
_pumpFIFO();
|
||||
}
|
||||
return (_writer - _reader) % _fifoSize;
|
||||
return (_fifoSize + _writer - _reader) % _fifoSize;
|
||||
}
|
||||
|
||||
int SerialUART::availableForWrite() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue