diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index 9c0ebed4..45521800 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -84,14 +84,13 @@ void SolarArrayDeploymentHandler::handleStateMachine() { break; case WAIT_FOR_MAIN_SWITCH_OFF: if (mainLineSwitcher->getSwitchState(mainLineSwitch) == PowerSwitchIF::SWITCH_OFF) { - stateMachine = FINISHED_DEPLOYMENT; + stateMachine = WAIT_ON_DELOYMENT_COMMAND; } else if (mainSwitchCountdown.hasTimedOut()) { triggerEvent(MAIN_SWITCH_OFF_TIMEOUT); - stateMachine = FINISHED_DEPLOYMENT; sif::error << "SolarArrayDeploymentHandler::handleStateMachine: Failed to switch main" << " switch off" << std::endl; + stateMachine = WAIT_ON_DELOYMENT_COMMAND; } - case FINISHED_DEPLOYMENT: break; default: sif::debug << "SolarArrayDeploymentHandler::handleStateMachine: Invalid state" << std::endl; @@ -143,7 +142,6 @@ void SolarArrayDeploymentHandler::switchDeploymentTransistors() { void SolarArrayDeploymentHandler::handleDeploymentFinish() { ReturnValue_t result = RETURN_OK; if (deploymentCountdown.hasTimedOut()) { - stateMachine = FINISHED_DEPLOYMENT; actionHelper.finish(rememberCommanderId, DEPLOY_SOLAR_ARRAYS, RETURN_OK); result = gpioInterface->pullLow(deplSA1); if (result != RETURN_OK) { @@ -157,6 +155,7 @@ void SolarArrayDeploymentHandler::handleDeploymentFinish() { } mainLineSwitcher->sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_OFF); mainSwitchCountdown.setTimeout(mainLineSwitcher->getSwitchDelayMs()); + stateMachine = WAIT_FOR_MAIN_SWITCH_OFF; } } diff --git a/mission/devices/SolarArrayDeploymentHandler.h b/mission/devices/SolarArrayDeploymentHandler.h index c45c2ba7..279ae5da 100644 --- a/mission/devices/SolarArrayDeploymentHandler.h +++ b/mission/devices/SolarArrayDeploymentHandler.h @@ -76,8 +76,7 @@ private: WAIT_ON_8V_SWITCH, SWITCH_DEPL_GPIOS, WAIT_ON_DEPLOYMENT_FINISH, - WAIT_FOR_MAIN_SWITCH_OFF, - FINISHED_DEPLOYMENT + WAIT_FOR_MAIN_SWITCH_OFF }; StateMachine stateMachine = WAIT_ON_DELOYMENT_COMMAND;