mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/TACOS.git
synced 2025-08-06 09:37:34 +00:00
Changed registerThread to accept shared_ptrs to fix some issues with polymorphism.
This commit is contained in:
@@ -12,6 +12,8 @@
|
||||
#include <sta/tacos/manager.hpp>
|
||||
#include <tasks/dummy.hpp>
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
||||
namespace sta
|
||||
{
|
||||
@@ -26,9 +28,9 @@ namespace sta
|
||||
{
|
||||
STA_DEBUG_PRINTLN("Starting manager task!");
|
||||
|
||||
// Manager::instance()->registerThread(demo::DummyTask("A"), {0, 1});
|
||||
// Manager::instance()->registerThread(demo::DummyTask("B"), {1, 2});
|
||||
// Manager::instance()->registerThread(demo::DummyTask("C"), {2, 3});
|
||||
Manager::instance()->registerThread(std::make_unique<demo::DummyTask>("A"), {0, 1});
|
||||
Manager::instance()->registerThread(std::make_unique<demo::DummyTask>("B"), {0, 2});
|
||||
Manager::instance()->registerThread(std::make_unique<demo::DummyTask>("C"), {0, 3});
|
||||
}
|
||||
} // namespace tacos
|
||||
} // namespace sta
|
||||
|
@@ -23,13 +23,15 @@ namespace demo
|
||||
|
||||
void DummyTask::init()
|
||||
{
|
||||
STA_DEBUG_PRINTLN("Initialized dummy task!");
|
||||
|
||||
}
|
||||
|
||||
void DummyTask::func()
|
||||
{
|
||||
STA_DEBUG_PRINT("Executing ");
|
||||
STA_DEBUG_PRINTLN(this->getName());
|
||||
// STA_DEBUG_PRINT("Executing ");
|
||||
// STA_DEBUG_PRINTLN(this->getName());
|
||||
osDelay(1000);
|
||||
}
|
||||
} // namespace demo
|
||||
|
||||
|
Reference in New Issue
Block a user