mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/TACOS.git
synced 2025-09-29 02:57:33 +00:00
Changed TacosThread termination to work correctly; fixed bugs in the testing
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include <tasks/disturb.hpp>
|
||||
#include <gpio.h>
|
||||
#include <sta/devices/stm32/gpio_pin.hpp>
|
||||
#include <sta/rtos/debug/heap_stats.hpp>
|
||||
|
||||
#include <memory>
|
||||
|
||||
@@ -39,6 +40,10 @@ namespace sta
|
||||
Manager::instance()->registerThread(std::make_shared<demo::DummyTask>("State 2 - FAIL"), {2});
|
||||
Manager::instance()->registerThread(std::make_shared<demo::Toggle>(), {0, 1});
|
||||
Manager::instance()->registerThread(std::make_shared<demo::DisturbTask>(), {0, 1});
|
||||
|
||||
STA_DEBUG_PRINTF("The answer to everything is %d", 42);
|
||||
|
||||
STA_DEBUG_HEAP_STATS();
|
||||
}
|
||||
} // namespace tacos
|
||||
} // namespace sta
|
||||
|
@@ -27,7 +27,7 @@ namespace demo
|
||||
osDelay(5000);
|
||||
|
||||
// Have we been requested to terminate while waiting?
|
||||
if (!isRunning())
|
||||
if (isTerminationRequested())
|
||||
return;
|
||||
|
||||
// Do some important stuff...
|
||||
@@ -38,14 +38,10 @@ namespace demo
|
||||
if (state != 2)
|
||||
{
|
||||
next = 1 - state;
|
||||
}
|
||||
else
|
||||
{
|
||||
next = 0;
|
||||
}
|
||||
|
||||
STA_DEBUG_PRINTLN("Toggle!");
|
||||
sta::tacos::Statemachine::instance()->requestStateTransition(state, next, 0);
|
||||
STA_DEBUG_PRINTLN("Toggle!");
|
||||
sta::tacos::Statemachine::instance()->requestStateTransition(state, next, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user