diff --git a/mission/system/DualLaneAssemblyBase.cpp b/mission/system/DualLaneAssemblyBase.cpp index 24759f58..9c163721 100644 --- a/mission/system/DualLaneAssemblyBase.cpp +++ b/mission/system/DualLaneAssemblyBase.cpp @@ -12,8 +12,10 @@ void DualLaneAssemblyBase::performChildOperation() { using namespace duallane; if (pwrStateMachine.active()) { pwrStateMachineWrapper(); - // This state is the indicator that the power state machine is done } + // Only perform the regular child operation if the power state machine is not active. + // It does not make any sense to command device modes while the power switcher is busy + // switching off or on devices. if (not pwrStateMachine.active()) { AssemblyBase::performChildOperation(); } @@ -61,8 +63,11 @@ ReturnValue_t DualLaneAssemblyBase::pwrStateMachineWrapper() { if (opCode == OpCodes::NONE) { return RETURN_OK; } else if (opCode == OpCodes::FINISH_OP) { + // Will be called for transitions to MODE_OFF, where everything is done after power switching finishModeOp(); } else if (opCode == OpCodes::START_TRANSITION) { + // Will be called for transitions from MODE_OFF to anything else, where the mode still has + // to be commanded after power switching AssemblyBase::startTransition(targetMode, targetSubmode); } else if (opCode == OpCodes::TIMEOUT_OCCURED) { if (powerRetryCounter == 0) {