diff options
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; } |