summaryrefslogtreecommitdiff
path: root/app/platform/stm32f0-gcc/ring_buffer.h
diff options
context:
space:
mode:
authorOxore <oxore@protonmail.com>2023-03-09 03:10:31 +0300
committerOxore <oxore@protonmail.com>2023-03-09 03:10:31 +0300
commit4c2caed73357c2173649d5a105cad5277eaa85f7 (patch)
tree74ce01d223c592d2fbadfc295761be2d74d5dab5 /app/platform/stm32f0-gcc/ring_buffer.h
parent7a0b96bf5c46521d6d8d2b527eb7099420a97aad (diff)
Fix UART buffering, now it works
Diffstat (limited to 'app/platform/stm32f0-gcc/ring_buffer.h')
-rw-r--r--app/platform/stm32f0-gcc/ring_buffer.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/platform/stm32f0-gcc/ring_buffer.h b/app/platform/stm32f0-gcc/ring_buffer.h
index ae4d99d..8e6c6be 100644
--- a/app/platform/stm32f0-gcc/ring_buffer.h
+++ b/app/platform/stm32f0-gcc/ring_buffer.h
@@ -46,7 +46,7 @@ public:
}
constexpr size_t Occupied()
{
- return _head - _tail + (_head >= _tail) ? 0 : _buffer_size;
+ return _head - _tail + ((_head >= _tail) ? 0 : _buffer_size);
}
constexpr bool IsEmpty() { return _head == _tail; }
constexpr bool IsFull() { return _tail + 1 == _head; }