initial commit
This commit is contained in:
22
ccs/state.h
Normal file
22
ccs/state.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#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);
|
||||
Reference in New Issue
Block a user