Merge pull request 'fix: force transition no longer restarts same state' (#36) from fix/force_transition into main

Reviewed-on: https://git.intern.spaceteamaachen.de/ALPAKA/TACOS/pulls/36
This commit is contained in:
carlwachter 2024-09-23 10:34:49 +00:00
commit 5b532087c8

View File

@ -72,7 +72,8 @@ namespace sta
transition.event = EventFlags::NORMAL;
transition.lockout = lockout;
if (force){
// Force the transition if requested, but only if the requested state is different from the current one.
if (force && transition.to != currentState_){
// Perform the transition and notify the threads. The event flags are set
// here in order to allow threads to react immediately.
currentState_ = transition.to;