state-handler: #6 add event class
This commit is contained in:
parent
b231d6e9db
commit
15a825bbd0
33
StateHandler/inc/Event.h
Normal file
33
StateHandler/inc/Event.h
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* Event.h
|
||||||
|
*
|
||||||
|
* Created on: Oct 5, 2022
|
||||||
|
* Author: tylen
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef EVENT_H_
|
||||||
|
#define EVENT_H_
|
||||||
|
|
||||||
|
class Event {
|
||||||
|
public:
|
||||||
|
virtual ~Event(){};
|
||||||
|
|
||||||
|
enum eventType {
|
||||||
|
/** Start of the event */
|
||||||
|
eEnter,
|
||||||
|
/** End of the event*/
|
||||||
|
eExit,
|
||||||
|
/** Button toggle event type (has values:
|
||||||
|
* temperature or button) */
|
||||||
|
eKey,
|
||||||
|
/** Time event */
|
||||||
|
eTick
|
||||||
|
};
|
||||||
|
Event(eventType e = eTick, int b = 0, int t = 0)
|
||||||
|
: type(e), button(b), temp(t){};
|
||||||
|
eventType type;
|
||||||
|
int button;
|
||||||
|
int temp;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* EVENT_H_ */
|
||||||
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
#include "DigitalIoPin.h"
|
#include "DigitalIoPin.h"
|
||||||
#include "Counter.h"
|
#include "Counter.h"
|
||||||
|
#include "Event.h"
|
||||||
|
|
||||||
/** Buttons enumeration
|
/** Buttons enumeration
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user