assign VOLATILE V2
This commit is contained in:
33
ccs/history.h
Executable file
33
ccs/history.h
Executable file
@@ -0,0 +1,33 @@
|
||||
#ifndef _history_h_
|
||||
#define _history_h_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define HISTORY_SIZE 20000
|
||||
|
||||
typedef struct HistoryEntry {
|
||||
uint8_t sensor;
|
||||
int error;
|
||||
} HistoryEntry;
|
||||
|
||||
typedef struct {
|
||||
HistoryEntry data[HISTORY_SIZE];
|
||||
int errors[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, HistoryEntry entry);
|
||||
|
||||
int hisbuf_pop(HistoryBuffer *sb);
|
||||
|
||||
int hisbuf_pop_data(HistoryBuffer *sb, HistoryEntry *out);
|
||||
|
||||
void hisbuf_get(HistoryBuffer *sb, HistoryEntry *out, int lookahead);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user