v1.15.0 #311

Merged
muellerr merged 107 commits from develop into main 2022-10-27 11:28:49 +02:00
2 changed files with 9 additions and 7 deletions
Showing only changes of commit 4714c15d65 - Show all commits

View File

@ -213,7 +213,7 @@ void SolarArrayDeploymentHandler::handleStateMachine() {
} }
} }
if (stateMachine == SWITCH_DEPL_GPIOS) { if (stateMachine == SWITCH_DEPL_GPIOS) {
burnCountdown.setTimeout(fsmInfo.burnCountdown); burnCountdown.setTimeout(fsmInfo.burnCountdownMs);
// This should never fail // This should never fail
channelAlternationCd.resetTimer(); channelAlternationCd.resetTimer();
if (not fsmInfo.dryRun) { if (not fsmInfo.dryRun) {
@ -268,16 +268,16 @@ bool SolarArrayDeploymentHandler::checkMainPower(bool onOff) {
return false; return false;
} }
bool SolarArrayDeploymentHandler::startFsmOn(uint32_t burnCountdown_, bool dryRun) { bool SolarArrayDeploymentHandler::startFsmOn(uint32_t burnCountdownSecs, bool dryRun) {
if (stateMachine != StateMachine::IDLE) { if (stateMachine != StateMachine::IDLE) {
return false; return false;
} }
if (burnCountdown_ > config::SA_DEPL_MAX_BURN_TIME) { if (burnCountdownSecs > config::SA_DEPL_MAX_BURN_TIME) {
burnCountdown_ = config::SA_DEPL_MAX_BURN_TIME; burnCountdownSecs = config::SA_DEPL_MAX_BURN_TIME;
} }
fsmInfo.onOff = true; fsmInfo.onOff = true;
fsmInfo.dryRun = dryRun; fsmInfo.dryRun = dryRun;
fsmInfo.burnCountdown = burnCountdown_; fsmInfo.burnCountdownMs = burnCountdownSecs * 1000;
stateMachine = StateMachine::MAIN_POWER_ON; stateMachine = StateMachine::MAIN_POWER_ON;
retryCounter = 0; retryCounter = 0;
return true; return true;
@ -346,9 +346,11 @@ ReturnValue_t SolarArrayDeploymentHandler::executeAction(ActionId_t actionId,
if (not startFsmOn(burnCountdown, cmd.isDryRun())) { if (not startFsmOn(burnCountdown, cmd.isDryRun())) {
return HasActionsIF::IS_BUSY; return HasActionsIF::IS_BUSY;
} }
actionActive = true;
return result; return result;
} else if (actionId == SWITCH_OFF_DEPLOYMENT) { } else if (actionId == SWITCH_OFF_DEPLOYMENT) {
startFsmOff(); startFsmOff();
actionActive = true;
return result; return result;
} else { } else {
return HasActionsIF::INVALID_ACTION_ID; return HasActionsIF::INVALID_ACTION_ID;

View File

@ -123,7 +123,7 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF,
bool onOff; bool onOff;
bool dryRun; bool dryRun;
bool alternationDummy = false; bool alternationDummy = false;
uint32_t burnCountdown = config::SA_DEPL_MAX_BURN_TIME; uint32_t burnCountdownMs = config::SA_DEPL_MAX_BURN_TIME;
}; };
static const uint8_t INTERFACE_ID = CLASS_ID::SA_DEPL_HANDLER; static const uint8_t INTERFACE_ID = CLASS_ID::SA_DEPL_HANDLER;
@ -150,7 +150,7 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF,
PeriodicOperationDivider opDivider = PeriodicOperationDivider(5); PeriodicOperationDivider opDivider = PeriodicOperationDivider(5);
uint8_t retryCounter = 3; uint8_t retryCounter = 3;
bool startFsmOn(uint32_t burnCountdown, bool dryRun); bool startFsmOn(uint32_t burnCountdownSecs, bool dryRun);
void startFsmOff(); void startFsmOff();
void finishFsm(ReturnValue_t resultForActionHelper); void finishFsm(ReturnValue_t resultForActionHelper);