From 0b394c2c08aea499862b83b121a08e7e61c072e1 Mon Sep 17 00:00:00 2001 From: Malo Lecomte Date: Sat, 17 Jul 2021 05:26:54 +0200 Subject: [PATCH] fix(ring_buffer): fixed pb when write_index comes back to 0 --- k/utils/ring_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k/utils/ring_buffer.c b/k/utils/ring_buffer.c index 7120ac3..fca3e90 100644 --- a/k/utils/ring_buffer.c +++ b/k/utils/ring_buffer.c @@ -2,7 +2,7 @@ uint8_t read_entry(struct ring_buffer *buf) { - if (buf->read >= buf->write) + if (buf->read == buf->write) return 0; uint8_t data = buf->buffer[buf->read];