-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstate_mgr.h
56 lines (44 loc) · 1.03 KB
/
state_mgr.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
/*
* state_mgr.h
*
* Created on: Mar 31, 2018
* Author: MisterCavespider
*/
#ifndef STATE_MGR_H_
#define STATE_MGR_H_
#include "gui.h"
#include "hardware.h"
#include "results.h"
#include "state_state.h"
class ProgramState;
class StateManager {
public:
EncoderCapsule *encc1;
EncoderCapsule *encc2;
EncoderCapsule *encc3;
EncoderCapsule *encc4;
GDISPLAY *disp;
ProgramState **states;
StateManager(uint8_t size,
EncoderCapsule *encc1, EncoderCapsule *encc2,
EncoderCapsule *encc3, EncoderCapsule *encc4,
GDISPLAY *disp);
elapsedMillis getUptime();
void resetUptime();
result_t setState(uint8_t i, ProgramState *state);
void setCurrentState(uint8_t state);
// Pass functions
void setup();
void loop();
result_t onAnything();
result_t onScrollPri(uint8_t flag, int16_t v);
result_t onScrollSec(uint8_t flag, int16_t v);
result_t onConfirm(uint8_t flag);
result_t onReturn(uint8_t flag);
~StateManager();
private:
uint8_t currI;
elapsedMillis uptime;
uint8_t size;
};
#endif /* STATE_MGR_H_ */