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
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -27,8 +27,7 @@ SdCardManager::SdCardManager() : SystemObject(objects::SDC_MANAGER), cmdExecutor
|
||||
}
|
||||
uint8_t prefSdRaw = 0;
|
||||
result = scratch::readNumber(scratch::PREFERED_SDC_KEY, prefSdRaw);
|
||||
result = mutex->unlockMutex();
|
||||
if (result != returnvalue::OK) {
|
||||
if (mutex->unlockMutex() != returnvalue::OK) {
|
||||
sif::error << "SdCardManager::SdCardManager: Mutex unlock failed" << std::endl;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user