-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEvent.h
63 lines (55 loc) · 886 Bytes
/
Event.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
62
63
/* A stm32duino eventloop
* Copyright (c) 2018 Andrew Goh
* Provided as-is, No warranties of any kind, Use at your own risk
* License: MIT
*/
#ifndef EVENT_H_
#define EVENT_H_
#include <Arduino.h>
enum class EventID : uint16_t {
Systick = 1,
Poweroff,
Sleep,
DeepSleep,
ScreenOff,
ScreenOn,
BattLow,
AppStart = 100,
AwaitComplete,
KeyEvent = 1000,
Key1,
Key2,
Key3,
Key4,
M_SELECT,
M_BACK,
M_NEXT,
M_PREV,
BeepOn,
BeepOff,
LedTaskLedOn,
LedTaskLedOff,
LedTaskFaster,
LedTaskSlower,
LedTaskShowMem,
LedTaskProcData
};
enum class EHandleID : uint8_t {
NoTask = 0,
KeySenderTask = 1,
LedTask,
BroadCast = 255
};
typedef struct Event {
EHandleID handle_id;
//uint8_t priority;
EventID event;
int param1;
int param2;
} TEvent;
class CEventHandler {
public:
virtual ~CEventHandler();
virtual bool handleEvent(Event& event) = 0;
};
#endif