eventhandler: #6 add basic members

This commit is contained in:
Vasily Davydov
2022-09-21 11:11:45 +03:00
parent 595243f41a
commit e8f3593704
4 changed files with 90 additions and 2 deletions

View 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_ */

View File

@@ -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;
};