extneded state machine for commanding support
This commit is contained in:
@ -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();
|
||||
|
Reference in New Issue
Block a user