Non Blocking SD Card Initialization #75

Merged
meierj merged 25 commits from mueller/non-blocking-sd-card-init into develop 2021-08-09 14:18:49 +02:00
Showing only changes of commit f56c8ba1c0 - Show all commits

View File

@ -205,6 +205,17 @@ ReturnValue_t CoreController::sdStateMachine() {
static_cast<int>(sdInfo.pref) << std::endl;
#endif
if(sdInfo.prefState == sd::SdState::MOUNTED) {
#if OBSW_VERBOSE_LEVEL >= 1
std::string mountString;
if(sdInfo.pref == sd::SdCard::SLOT_0) {
mountString = SdCardManager::SD_0_MOUNT_POINT;
}
else {
mountString = SdCardManager::SD_1_MOUNT_POINT;
}
sif::info << "SD card " << sdInfo.prefChar << " already on and mounted at " <<
mountString << std::endl;
#endif
sdInfo.state = SdStates::DETERMINE_OTHER;
}
else if(sdInfo.prefState == sd::SdState::OFF) {
@ -216,11 +227,12 @@ ReturnValue_t CoreController::sdStateMachine() {
}
}
else {
nonBlockingOpChecking(SdStates::MOUNT_SELF, 10, "Setting SDC state");
if(nonBlockingOpChecking(SdStates::MOUNT_SELF, 10, "Setting SDC state")) {
sdInfo.prefState = sd::SdState::ON;
currentStateSetter(sdInfo.pref, sd::SdState::ON);
}
}
}
if(sdInfo.state == SdStates::MOUNT_SELF) {
if(not sdInfo.commandExecuted) {
@ -284,11 +296,12 @@ ReturnValue_t CoreController::sdStateMachine() {
sdInfo.commandExecuted = true;
}
else {
nonBlockingOpChecking(SdStates::MOUNT_UNMOUNT_OTHER, 10,
"Switching on other SD card");
if(nonBlockingOpChecking(SdStates::MOUNT_UNMOUNT_OTHER, 10,
"Switching on other SD card")) {
sdInfo.otherState = sd::SdState::ON;
currentStateSetter(sdInfo.other, sd::SdState::ON);
}
}
#endif
}