From b88a1dd2ee67c8fae84f68ae19b9ee1b89e2472a Mon Sep 17 00:00:00 2001 From: Vasily Davydov Date: Thu, 13 Apr 2023 19:20:38 +0300 Subject: [PATCH 1/2] threads: add Event class for master communication #6 --- source/shoh/src/threads/common/ThreadCommon.h | 41 +++++++++++++++++++ source/shoh/src/threads/master/Master.h | 2 + 2 files changed, 43 insertions(+) create mode 100644 source/shoh/src/threads/common/ThreadCommon.h 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; }; From 4a818e9e246118252ddb76b5033ac5c1530e54e5 Mon Sep 17 00:00:00 2001 From: Vasily Davydov Date: Thu, 13 Apr 2023 19:23:50 +0300 Subject: [PATCH 2/2] root: add .vscode to gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 22c2aef..3b936fd 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,7 @@ AzureRTOS_TAD_logs/ FreeRTOS_TAD_logs/ source/test/ source/shoh/.settings/language.settings.xml + +#Code + +.vscode/