extneded state machine for commanding support
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
2021-08-08 01:24:18 +02:00
parent 1c0ea5cbb1
commit f50b9de4a5
2 changed files with 138 additions and 38 deletions

View File

@ -77,12 +77,9 @@ private:
SKIP_CYCLE_BEFORE_INFO_UPDATE,
UPDATE_INFO,
// SD initialization done
DONE,
IDLE,
// Used if SD switches or mount commands are issued via telecommand
SET_STATE_FROM_COMMAND,
MOUNT_FROM_COMMAND,
UNMOUNT_FROM_COMMAND,
};
static constexpr bool BLOCKING_SD_INIT = false;
@ -99,10 +96,15 @@ private:
std::string prefChar = "0";
std::string otherChar = "1";
SdStates state = SdStates::START;
// Used to track whether a command was executed
bool commandExecuted = true;
bool initFinished = false;
SdCardManager::SdStatePair currentState;
uint16_t cycleCount = 0;
// These two flags are related to external commanding
bool commandIssued = false;
bool commandFinished = false;
sd::SdState currentlyCommandedState = sd::SdState::OFF;
sd::SdCard commandedCard = sd::SdCard::NONE;
sd::SdState commandedState = sd::SdState::OFF;
};
@ -113,7 +115,10 @@ private:
ReturnValue_t sdCardSetup(sd::SdCard sdCard, sd::SdState targetState, std::string sdChar,
bool printOutput = true);
ReturnValue_t sdColdRedundantBlockingInit();
void currentStateSetter(sd::SdCard sdCard, sd::SdState newState);
void determinePreferredSdCard();
void executeNextExternalSdCommand();
void checkExternalSdCommandStatus();
ReturnValue_t initVersionFile();
ReturnValue_t initBootCopy();