Unverified Commit cabb06d4 authored by Earle F. Philhower, III's avatar Earle F. Philhower, III Committed by GitHub

Fix UART wrong ::available() during wraparound (#739)

Fixes #735 .  Thanks to @ Haggarman for the find and fix.
parent 005cba3a
......@@ -292,7 +292,7 @@ int SerialUART::available() {
} else {
_pumpFIFO();
}
return (_writer - _reader) % _fifoSize;
return (_fifoSize + _writer - _reader) % _fifoSize;
}
int SerialUART::availableForWrite() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment