Merge pull request #18 from vas-dav/thread-master

Create Event
This commit is contained in:
RedHawk 2023-04-18 15:51:08 +03:00 committed by GitHub
commit 99677b2bd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;
};
}

View File

@ -12,6 +12,7 @@
#include "board.h" #include "board.h"
#include "FreeRTOSCPP/Task.hpp" #include "FreeRTOSCPP/Task.hpp"
#include "FreeRTOSCPP/Kernel.hpp" #include "FreeRTOSCPP/Kernel.hpp"
#include "threads/common/ThreadCommon.h"
#include "task.h" #include "task.h"
@ -28,6 +29,7 @@ public:
void taskFunction(); void taskFunction();
private: private:
int led; int led;
std::shared_ptr<ThreadCommon::Event> message;
}; };