fix(ring_buffer): fixed pb when write_index comes back to 0

This commit is contained in:
Malo Lecomte 2021-07-17 05:26:54 +02:00
parent f7246ffcdb
commit 0b394c2c08

@ -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];