commit
99677b2bd5
41
source/shoh/src/threads/common/ThreadCommon.h
Normal file
41
source/shoh/src/threads/common/ThreadCommon.h
Normal 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;
|
||||
};
|
||||
}
|
||||
@ -12,6 +12,7 @@
|
||||
#include "board.h"
|
||||
#include "FreeRTOSCPP/Task.hpp"
|
||||
#include "FreeRTOSCPP/Kernel.hpp"
|
||||
#include "threads/common/ThreadCommon.h"
|
||||
#include "task.h"
|
||||
|
||||
|
||||
@ -28,6 +29,7 @@ public:
|
||||
void taskFunction();
|
||||
private:
|
||||
int led;
|
||||
std::shared_ptr<ThreadCommon::Event> message;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user