Dual Side to Single Side Bugfix #497
@ -34,10 +34,17 @@ void DualLaneAssemblyBase::performChildOperation() {
|
||||
}
|
||||
|
||||
void DualLaneAssemblyBase::startTransition(Mode_t mode, Submode_t submode) {
|
||||
// doStartTransition(mode, submode);
|
||||
using namespace duallane;
|
||||
pwrStateMachine.reset();
|
||||
if (mode != MODE_OFF) {
|
||||
// Special exception: A transition from dual side to single mode must be handled like
|
||||
// going OFF.
|
||||
if ((this->mode == MODE_ON or this->mode == DeviceHandlerIF::MODE_NORMAL) and
|
||||
this->submode == DUAL_MODE and submode != DUAL_MODE) {
|
||||
dualToSingleSideTransition = true;
|
||||
AssemblyBase::startTransition(mode, submode);
|
||||
return;
|
||||
}
|
||||
// If anything other than MODE_OFF is commanded, perform power state machine first
|
||||
// Cache the target modes, required by power state machine
|
||||
pwrStateMachine.start(mode, submode);
|
||||
@ -111,7 +118,7 @@ ReturnValue_t DualLaneAssemblyBase::isModeCombinationValid(Mode_t mode, Submode_
|
||||
|
||||
void DualLaneAssemblyBase::handleModeReached() {
|
||||
using namespace duallane;
|
||||
if (targetMode == MODE_OFF) {
|
||||
if (targetMode == MODE_OFF or dualToSingleSideTransition) {
|
||||
pwrStateMachine.start(targetMode, targetSubmode);
|
||||
// Now we can switch off the power. After that, the AssemblyBase::handleModeReached function
|
||||
// will be called
|
||||
@ -229,6 +236,7 @@ void DualLaneAssemblyBase::finishModeOp() {
|
||||
pwrStateMachine.reset();
|
||||
powerRetryCounter = 0;
|
||||
tryingOtherSide = false;
|
||||
dualToSingleSideTransition = false;
|
||||
dualModeErrorSwitch = true;
|
||||
}
|
||||
|
||||
|
@ -31,6 +31,7 @@ class DualLaneAssemblyBase : public AssemblyBase, public ConfirmsFailuresIF {
|
||||
uint8_t powerRetryCounter = 0;
|
||||
bool tryingOtherSide = false;
|
||||
bool dualModeErrorSwitch = true;
|
||||
bool dualToSingleSideTransition = false;
|
||||
duallane::Submodes defaultSubmode = duallane::Submodes::A_SIDE;
|
||||
|
||||
enum RecoveryCustomStates {
|
||||
|
Loading…
Reference in New Issue
Block a user