threads: add Event class for master communication #6

This commit is contained in:
Vasily Davydov
2023-04-13 19:20:38 +03:00
parent 409fb44d2c
commit b88a1dd2ee
2 changed files with 43 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
/*
* ThreadCommon.h
*
* Created on: 13 Apr 2023
* Author: tylen
*/
#include "board.h"
namespace ThreadCommon
{
typedef enum EventType
{
Rotary,
Temperature,
Manager
};
class Event
{
public:
Event(ThreadCommon::EventType type, uint8_t data)
{
_type = type;
_data = data;
}
ThreadCommon::EventType getType() const
{
return _type;
}
uint8_t getData() const
{
return _data;
}
private:
ThreadCommon::EventType _type;
uint8_t _data;
};
}