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

This commit is contained in:
aliamelo committed 2021-07-17 05:26:54 +02:00
1 parent f7246ffcdb
commit 0b394c2c08
1 file changed
+1 -1
+1 -1
View File
@@ -2,7 +2,7 @@
uint8_t read_entry(struct ring_buffer *buf) uint8_t read_entry(struct ring_buffer *buf)
{ {
if (buf->read >= buf->write) if (buf->read == buf->write)
return 0; return 0;
uint8_t data = buf->buffer[buf->read]; uint8_t data = buf->buffer[buf->read];
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.