diff options
author | Oxore <oxore@protonmail.com> | 2023-03-09 03:10:31 +0300 |
---|---|---|
committer | Oxore <oxore@protonmail.com> | 2023-03-09 03:10:31 +0300 |
commit | 4c2caed73357c2173649d5a105cad5277eaa85f7 (patch) | |
tree | 74ce01d223c592d2fbadfc295761be2d74d5dab5 /app/platform/stm32f0-gcc/ring_buffer.h | |
parent | 7a0b96bf5c46521d6d8d2b527eb7099420a97aad (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.h | 2 |
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; } |