some more fixes
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

This commit is contained in:
Robin Müller 2023-03-20 11:12:19 +01:00
parent 5890e639fe
commit 74bb27e61f
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814

View File

@ -82,9 +82,13 @@ ReturnValue_t DualLaneAssemblyBase::pwrStateMachineWrapper() {
// Will be called for transitions to MODE_OFF, where everything is done after power switching // Will be called for transitions to MODE_OFF, where everything is done after power switching
finishModeOp(); finishModeOp();
} else if (opCode == OpCodes::TO_NOT_OFF_DONE) { } else if (opCode == OpCodes::TO_NOT_OFF_DONE) {
if (dualToSingleSideTransition) {
finishModeOp();
} else {
// Will be called for transitions from MODE_OFF to anything else, where the mode still has // Will be called for transitions from MODE_OFF to anything else, where the mode still has
// to be commanded after power switching // to be commanded after power switching
AssemblyBase::startTransition(targetMode, targetSubmode); AssemblyBase::startTransition(targetMode, targetSubmode);
}
} else if (opCode == OpCodes::TIMEOUT_OCCURED) { } else if (opCode == OpCodes::TIMEOUT_OCCURED) {
if (powerRetryCounter == 0) { if (powerRetryCounter == 0) {
powerRetryCounter++; powerRetryCounter++;
@ -118,13 +122,20 @@ ReturnValue_t DualLaneAssemblyBase::isModeCombinationValid(Mode_t mode, Submode_
void DualLaneAssemblyBase::handleModeReached() { void DualLaneAssemblyBase::handleModeReached() {
using namespace duallane; using namespace duallane;
if (targetMode == MODE_OFF or dualToSingleSideTransition) { if (targetMode == MODE_OFF) {
pwrStateMachine.start(targetMode, targetSubmode); pwrStateMachine.start(targetMode, targetSubmode);
// Now we can switch off the power. After that, the AssemblyBase::handleModeReached function // Now we can switch off the power. After that, the AssemblyBase::handleModeReached function
// will be called // will be called
// Ignore failures for now. // Ignore failures for now.
pwrStateMachineWrapper(); pwrStateMachineWrapper();
} else { } else {
// For dual to single side transition, devices should be logically off, but the switch
// handling still needs to be done.
if (dualToSingleSideTransition) {
pwrStateMachine.start(targetMode, targetSubmode);
pwrStateMachineWrapper();
return;
}
finishModeOp(); finishModeOp();
} }
} }