that should fix the issue
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
2023-03-31 19:14:42 +02:00
parent e365e03c2a
commit 65989261b0
4 changed files with 26 additions and 15 deletions

View File

@ -130,7 +130,11 @@ void DualLaneAssemblyBase::handleModeReached() {
// 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);
if (sideSwitchState == SideSwitchState::DISABLE_OTHER_SIDE) {
pwrStateMachine.start(targetMode, targetSubmodeForSideSwitch);
} else {
pwrStateMachine.start(targetMode, targetSubmode);
}
pwrStateMachineWrapper();
return;
}
@ -238,6 +242,24 @@ bool DualLaneAssemblyBase::sideSwitchTransition(Mode_t mode, Submode_t submode)
return false;
}
void DualLaneAssemblyBase::handleSideSwitchStates(uint8_t& submode, bool& needsSecondStep) {
if (sideSwitchState == SideSwitchState::REQUESTED) {
sideSwitchState = SideSwitchState::TO_DUAL;
}
// Switch to dual side first, and later switch back to the otherside
if (sideSwitchState == SideSwitchState::TO_DUAL) {
targetSubmodeForSideSwitch = static_cast<duallane::Submodes>(submode);
submode = duallane::Submodes::DUAL_MODE;
sideSwitchState = SideSwitchState::DISABLE_OTHER_SIDE;
// TODO: Ugly hack. The base class should support arbitrary number of steps..
needsSecondStep = true;
} else if (sideSwitchState == SideSwitchState::DISABLE_OTHER_SIDE) {
// Set this flag because the power needs to be switched off.
dualToSingleSideTransition = true;
submode = targetSubmodeForSideSwitch;
}
}
void DualLaneAssemblyBase::finishModeOp() {
using namespace duallane;
AssemblyBase::handleModeReached();