-
Notifications
You must be signed in to change notification settings - Fork 0
/
cep.h
61 lines (42 loc) · 1.26 KB
/
cep.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef Fifo_h
#define Fifo_h
#include <Arduino.h>
#define TTL 4000
#define TIMESTAMP_DATASIZE 4
#define DEFAULT_NUMBER_MSG 10
// computed size: buffer_size * (stamp size + sum(data_size))
#define M1_NUMBER_MSG DEFAULT_NUMBER_MSG
#define M1_ELEMENT_SIZE (TIMESTAMP_DATASIZE + 2)
#define M1_FIFO_SIZE ((M1_NUMBER_MSG * M1_ELEMENT_SIZE) + 1)
#define M2_NUMBER_MSG DEFAULT_NUMBER_MSG
#define M2_ELEMENT_SIZE (TIMESTAMP_DATASIZE)
#define M2_FIFO_SIZE ((M2_NUMBER_MSG * M2_ELEMENT_SIZE) + 1)
class streamFilteredJoin1_Fifo
{
public:
streamFilteredJoin1_Fifo();
~streamFilteredJoin1_Fifo();
int m1_length();
int m2_length();
int m1_available();
int m2_available();
inline boolean m1_isEmpty();
inline boolean m2_isEmpty();
inline boolean m1_isFull();
inline boolean m2_isFull();
void dump();
void m1_queueEvent(int param);
void m2_queueEvent();
void m1_popEvent();
void m2_popEvent();
void checkTrigger();
//boolean popEvent(int* eventCode, void* eventParam);
private:
byte m1_fifo[M1_FIFO_SIZE];
byte m2_fifo[M2_FIFO_SIZE];
unsigned int m1_fifo_head = 0;
unsigned int m1_fifo_tail = 0;
unsigned int m2_fifo_head = 0;
unsigned int m2_fifo_tail = 0;
};
#endif