diff --git a/source/shoh/src/threads/common/ThreadCommon.h b/source/shoh/src/threads/common/ThreadCommon.h new file mode 100644 index 0000000..634b627 --- /dev/null +++ b/source/shoh/src/threads/common/ThreadCommon.h @@ -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; + }; +} diff --git a/source/shoh/src/threads/master/Master.h b/source/shoh/src/threads/master/Master.h index fa22b83..4b9b83a 100644 --- a/source/shoh/src/threads/master/Master.h +++ b/source/shoh/src/threads/master/Master.h @@ -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 message; };