Merge remote-tracking branch 'origin/develop' into mueller/acs-ss-init
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
2022-10-11 23:13:37 +02:00
7 changed files with 37 additions and 29 deletions

View File

@ -1227,29 +1227,29 @@ void CoreController::performWatchdogControlOperation() {
}
void CoreController::performMountedSdCardOperations() {
auto mountedSdCardOp = [&](bool &mntSwitch, sd::SdCard sdCard, std::string mntPoint) {
if (mntSwitch) {
bool sdCardMounted = sdcMan->isSdCardUsable(sdCard);
if (sdCardMounted and not performOneShotSdCardOpsSwitch) {
std::ostringstream path;
path << mntPoint << "/" << CONF_FOLDER;
if (not std::filesystem::exists(path.str())) {
std::filesystem::create_directory(path.str());
}
initVersionFile();
initClockFromTimeFile();
performRebootFileHandling(false);
performOneShotSdCardOpsSwitch = true;
auto mountedSdCardOp = [&](sd::SdCard sdCard, std::string mntPoint) {
if (not performOneShotSdCardOpsSwitch) {
std::ostringstream path;
path << mntPoint << "/" << CONF_FOLDER;
if (not std::filesystem::exists(path.str())) {
std::filesystem::create_directory(path.str());
}
mntSwitch = false;
initVersionFile();
initClockFromTimeFile();
performRebootFileHandling(false);
}
};
if (sdInfo.active == sd::SdCard::SLOT_1) {
mountedSdCardOp(sdInfo.mountSwitch.second, sd::SdCard::SLOT_1, config::SD_1_MOUNT_POINT);
mountedSdCardOp(sdInfo.mountSwitch.first, sd::SdCard::SLOT_0, config::SD_0_MOUNT_POINT);
} else {
mountedSdCardOp(sdInfo.mountSwitch.first, sd::SdCard::SLOT_0, config::SD_0_MOUNT_POINT);
mountedSdCardOp(sdInfo.mountSwitch.second, sd::SdCard::SLOT_1, config::SD_1_MOUNT_POINT);
bool clearOneShotFlag = false;
if (sdInfo.active == sd::SdCard::SLOT_0 and sdcMan->isSdCardUsable(sd::SdCard::SLOT_0)) {
mountedSdCardOp(sd::SdCard::SLOT_0, config::SD_0_MOUNT_POINT);
clearOneShotFlag = true;
}
if (sdInfo.active == sd::SdCard::SLOT_1 and sdcMan->isSdCardUsable(sd::SdCard::SLOT_1)) {
mountedSdCardOp(sd::SdCard::SLOT_1, config::SD_1_MOUNT_POINT);
clearOneShotFlag = true;
}
if (clearOneShotFlag) {
performOneShotSdCardOpsSwitch = true;
}
timeFileHandler();
}

View File

@ -205,7 +205,7 @@ class CoreController : public ExtendedControllerBase {
RebootFile rebootFile = {};
std::string currMntPrefix;
bool performOneShotSdCardOpsSwitch = true;
bool performOneShotSdCardOpsSwitch = false;
/**
* Index 0: Chip 0 Copy 0