aboutsummaryrefslogtreecommitdiffstats
path: root/Projects/Benito/Benito.c
diff options
context:
space:
mode:
Diffstat (limited to 'Projects/Benito/Benito.c')
-rw-r--r--Projects/Benito/Benito.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/Projects/Benito/Benito.c b/Projects/Benito/Benito.c
index ac1e064d5..88005eeb0 100644
--- a/Projects/Benito/Benito.c
+++ b/Projects/Benito/Benito.c
@@ -127,13 +127,14 @@ int main(void)
LEDs_TurnOffLEDs(LEDMASK_RX);
/* Check if the receive buffer flush period has expired */
- if (!(--FlushPeriodRemaining) || (Tx_Buffer.Count > 200))
+ RingBuff_Count_t BufferCount = RingBuffer_GetCount(&Tx_Buffer);
+ if (!(--FlushPeriodRemaining) || (BufferCount > 200))
{
/* Echo bytes from the target to the host via the virtual serial port */
- if (Tx_Buffer.Count)
+ if (BufferCount)
{
- while (Tx_Buffer.Count)
- CDC_Device_SendByte(&VirtualSerial_CDC_Interface, RingBuffer_AtomicRemove(&Tx_Buffer));
+ while (BufferCount--)
+ CDC_Device_SendByte(&VirtualSerial_CDC_Interface, RingBuffer_Remove(&Tx_Buffer));
LEDs_TurnOnLEDs(LEDMASK_RX);
PulseMSRemaining.RxLEDPulse = TX_RX_LED_PULSE_MS;