#pragma once #include #define STATE_SENSOR_BUFFER_SIZE 8 typedef struct { uint8_t buffer[STATE_SENSOR_BUFFER_SIZE]; int front; int rear; int size; } SensorBuffer; void senbuf_init(SensorBuffer *sb); int senbuf_is_full(SensorBuffer *sb); int senbuf_push(SensorBuffer *sb, uint8_t value); int senbuf_pop(SensorBuffer *sb); void senbuf_get(SensorBuffer *sb, uint8_t *out, int lookahead);