diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index eaecae37..3985eb21 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -54,9 +54,6 @@ ReturnValue_t SolarArrayDeploymentHandler::performOperation(uint8_t operationCod } readCommandQueue(); handleStateMachine(); - if (firstCycle) { - firstCycle = false; - } return returnvalue::OK; } @@ -214,7 +211,7 @@ bool SolarArrayDeploymentHandler::autonomousDeplForFile(sd::SdCard sdCard, const } // Uptime has increased by X seconds so we need to update the uptime count inside the file secsSinceBoot += Clock::getUptime().tv_sec; - if (stateSwitch or firstCycle) { + if (stateSwitch or firstAutonomousCycle) { if (deplState == AutonomousDeplState::FIRST_BURN or deplState == AutonomousDeplState::SECOND_BURN) { startFsmOn(config::SA_DEPL_BURN_TIME_SECS, dryRun); @@ -245,6 +242,9 @@ bool SolarArrayDeploymentHandler::autonomousDeplForFile(sd::SdCard sdCard, const } of << "secs_since_start: " << std::to_string(secsSinceBoot) << "\n"; } + if (firstAutonomousCycle) { + firstAutonomousCycle = false; + } return true; } diff --git a/mission/devices/SolarArrayDeploymentHandler.h b/mission/devices/SolarArrayDeploymentHandler.h index a5b3a10e..b935b096 100644 --- a/mission/devices/SolarArrayDeploymentHandler.h +++ b/mission/devices/SolarArrayDeploymentHandler.h @@ -151,7 +151,7 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, FsmInfo fsmInfo; StateMachine stateMachine = IDLE; bool actionActive = false; - bool firstCycle = true; + bool firstAutonomousCycle = true; ActionId_t activeCmd = HasActionsIF::INVALID_ACTION_ID; std::optional initUptime; PeriodicOperationDivider opDivider = PeriodicOperationDivider(5);