Browse Source

AP_HAL_AVR Console: bugfix on buffer bytes free vs used

* had them reversed. doh
master
Pat Hickey 13 years ago committed by Andrew Tridgell
parent
commit
40734bc2f2
  1. 4
      libraries/AP_HAL_AVR/Console.cpp

4
libraries/AP_HAL_AVR/Console.cpp

@ -174,11 +174,11 @@ int AVRConsoleDriver::Buffer::peek() { @@ -174,11 +174,11 @@ int AVRConsoleDriver::Buffer::peek() {
return (int) b;
}
uint16_t AVRConsoleDriver::Buffer::bytes_free() {
uint16_t AVRConsoleDriver::Buffer::bytes_used() {
return ((_head - _tail) & _mask);
}
uint16_t AVRConsoleDriver::Buffer::bytes_used() {
uint16_t AVRConsoleDriver::Buffer::bytes_free() {
return ((_mask+1) - ((_head - _tail) & _mask));
}

Loading…
Cancel
Save