basic SD card remount FDIR
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
2022-10-14 15:33:34 +02:00
parent e9a4c63127
commit c800ddfa31
4 changed files with 35 additions and 8 deletions

View File

@ -4,7 +4,6 @@
#include <fsfw/filesystem/HasFileSystemIF.h>
#include <fsfw/ipc/QueueFactory.h>
#include "OBSWConfig.h"
#include "OBSWVersion.h"
#include "fsfw/serviceinterface/ServiceInterface.h"
#include "fsfw/timemanager/Stopwatch.h"
@ -1243,16 +1242,16 @@ void CoreController::performMountedSdCardOperations() {
}
timeFileHandler();
};
bool clearOneShotFlag = false;
bool someSdCardActive = 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;
someSdCardActive = 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;
someSdCardActive = true;
}
if (clearOneShotFlag) {
if (someSdCardActive) {
performOneShotSdCardOpsSwitch = true;
}
}
@ -1295,7 +1294,19 @@ ReturnValue_t CoreController::performSdCardCheck() {
if (active.second == sd::SdState::MOUNTED) {
sdCardCheck(sd::SdCard::SLOT_1);
}
#if OBSW_SD_CARD_MUST_BE_ON == 1
// This is FDIR. The core controller will attempt once to get some SD card working
bool someSdCardActive = false;
if ((sdInfo.active == sd::SdCard::SLOT_0 and sdcMan->isSdCardUsable(sd::SdCard::SLOT_0)) or
(sdInfo.active == sd::SdCard::SLOT_1 and sdcMan->isSdCardUsable(sd::SdCard::SLOT_1))) {
someSdCardActive = true;
}
if (not someSdCardActive and remountAttemptFlag) {
triggerEvent(NO_SD_CARD_ACTIVE);
initSdCardBlocking();
remountAttemptFlag = false;
}
#endif
return returnvalue::OK;
}