state-handler: #6 add event class

This commit is contained in:
Vasily Davydov 2022-10-05 11:26:08 +03:00
parent b231d6e9db
commit 15a825bbd0
2 changed files with 34 additions and 0 deletions

33
StateHandler/inc/Event.h Normal file
View 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_ */

View File

@ -17,6 +17,7 @@
#include "DigitalIoPin.h" #include "DigitalIoPin.h"
#include "Counter.h" #include "Counter.h"
#include "Event.h"
/** Buttons enumeration /** Buttons enumeration
* *