tested hot redundant config as well

This commit is contained in:
2021-08-08 00:37:07 +02:00
parent 5a4d287f67
commit 1c0ea5cbb1
2 changed files with 44 additions and 30 deletions

View File

@ -60,19 +60,29 @@ private:
ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode,
uint32_t *msToReachTheMode);
// States for non-blocking setup
// States for SD state machine, which is used in non-blocking mode
enum class SdStates {
NONE,
START,
GET_INFO,
SET_STATE_SELF,
MOUNT_SELF,
// Determine operations for other SD card, depending on redundancy configuration
DETERMINE_OTHER,
SET_STATE_OTHER,
// Mount or unmount other
MOUNT_UNMOUNT_OTHER,
// Skip period because the shell command used to generate the info file sometimes is
// missing the last performed operation if executed too early
SKIP_CYCLE_BEFORE_INFO_UPDATE,
UPDATE_INFO,
DONE
// SD initialization done
DONE,
// 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;
@ -93,6 +103,8 @@ private:
bool initFinished = false;
SdCardManager::SdStatePair currentState;
uint16_t cycleCount = 0;
sd::SdCard commandedCard = sd::SdCard::NONE;
sd::SdState commandedState = sd::SdState::OFF;
};
SdInfo sdInfo;