From 4c2caed73357c2173649d5a105cad5277eaa85f7 Mon Sep 17 00:00:00 2001 From: Oxore Date: Thu, 9 Mar 2023 03:10:31 +0300 Subject: Fix UART buffering, now it works --- app/platform/stm32f0-gcc/ring_buffer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/platform/stm32f0-gcc/ring_buffer.h') 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; } -- cgit v1.2.3