eventhandler: #6 add basic members
This commit is contained in:
26
EventHandler/inc/Counter.h
Normal file
26
EventHandler/inc/Counter.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Counter.h
|
||||
*
|
||||
* Created on: Sep 1, 2022
|
||||
* Author: tylen
|
||||
*/
|
||||
|
||||
#ifndef COUNTER_H_
|
||||
#define COUNTER_H_
|
||||
|
||||
class Counter {
|
||||
|
||||
public:
|
||||
Counter(int i, int up);
|
||||
void inc();
|
||||
void dec();
|
||||
int getInit();
|
||||
void setInit(int i);
|
||||
~Counter() = default;
|
||||
|
||||
private:
|
||||
int init;
|
||||
int up_lim;
|
||||
|
||||
};
|
||||
#endif /* COUNTER_H_ */
|
||||
@@ -9,6 +9,7 @@
|
||||
#define EVENTHANDLER_H_
|
||||
|
||||
#include "DigitalIoPin.h"
|
||||
#include "Counter.h"
|
||||
|
||||
typedef struct _EVENT_HANDL{
|
||||
DigitalIoPin * _button_control_up;
|
||||
@@ -19,10 +20,15 @@ typedef struct _EVENT_HANDL{
|
||||
|
||||
class EventHandler {
|
||||
public:
|
||||
EventHandler(EVENT_HANDL * btns);
|
||||
EventHandler(EVENT_HANDL btns);
|
||||
virtual ~EventHandler();
|
||||
int getSetPresuure();
|
||||
int getSetSpeed();
|
||||
private:
|
||||
EVENT_HANDL = {0,0,0,0};
|
||||
EVENT_HANDL internal = {0,0,0,0};
|
||||
bool mode;
|
||||
Counter * bar_pressure;
|
||||
Counter * bar_speed;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user