mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/TACOS.git
synced 2025-09-28 18:57:33 +00:00
Changed statemachine to only check for transitions if the lockout timer is not running
This commit is contained in:
@@ -32,13 +32,15 @@ namespace sta
|
||||
}
|
||||
|
||||
void Statemachine::func()
|
||||
{
|
||||
if (!lockoutTimer_.isRunning())
|
||||
{
|
||||
uint16_t next = transitionFunc_(currentState_);
|
||||
|
||||
STA_ASSERT(next < STA_TACOS_NUM_STATES);
|
||||
|
||||
// Check if a state change is desired. Block if the lockoutTimer is still running.
|
||||
if (next != currentState_ && !lockoutTimer_.isRunning())
|
||||
if (next != currentState_)
|
||||
{
|
||||
if (failsafeTimer_.isRunning())
|
||||
{
|
||||
@@ -53,6 +55,7 @@ namespace sta
|
||||
Statemachine::stateChangeEvent.set(EventFlags::NORMAL);
|
||||
Statemachine::stateChangeEvent.clear(EventFlags::ALL);
|
||||
}
|
||||
}
|
||||
|
||||
osThreadYield();
|
||||
}
|
||||
|
Reference in New Issue
Block a user