Changed TacosThread termination to work correctly; fixed bugs in the testing

This commit is contained in:
dario
2023-11-29 20:12:45 +01:00
committed by carlwachter
parent a70dc00f4c
commit 2b4e634179
7 changed files with 22 additions and 15 deletions

View File

@@ -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);
}
}
}