From 40734bc2f20eba32030d99a967ffdd2aabc5e2cb Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Tue, 18 Sep 2012 17:18:01 -0700 Subject: [PATCH] AP_HAL_AVR Console: bugfix on buffer bytes free vs used * had them reversed. doh --- libraries/AP_HAL_AVR/Console.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_HAL_AVR/Console.cpp b/libraries/AP_HAL_AVR/Console.cpp index b5825f0e588..ddd78081c11 100644 --- a/libraries/AP_HAL_AVR/Console.cpp +++ b/libraries/AP_HAL_AVR/Console.cpp @@ -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)); }