약간의 수정

This commit is contained in:
2025-12-09 02:34:41 +09:00
parent 0697b5ab31
commit d3a2802333
22 changed files with 406 additions and 25 deletions

23
ccs/state.h Normal file → Executable file
View File

@@ -20,3 +20,26 @@ int senbuf_push(SensorBuffer *sb, uint8_t value);
int senbuf_pop(SensorBuffer *sb);
void senbuf_get(SensorBuffer *sb, uint8_t *out, int lookahead);
// History Buffer
#define HISTORY_SIZE 20000
typedef struct {
uint8_t buffer[HISTORY_SIZE];
int front;
int rear;
int size;
} HistoryBuffer;
void hisbuf_init(HistoryBuffer *sb);
int hisbuf_is_full(HistoryBuffer *sb);
int hisbuf_push(HistoryBuffer *sb, uint8_t value);
int hisbuf_pop(HistoryBuffer *sb);
void hisbuf_get(HistoryBuffer *sb, uint8_t *out, int lookahead);