AP_HAL_AVR Console: bugfix on buffer bytes free vs used

* had them reversed. doh
This commit is contained in:
Pat Hickey authored and Andrew Tridgell committed 2012-12-20 14:51:25 +11:00
1 parent fd89bacbc8
commit 40734bc2f2
1 file changed
+2 -2
+2 -2
View File
@@ -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));
}