bugfix for file system handler, running now

This commit is contained in:
2021-07-19 14:02:17 +02:00
committed by Robin Mueller
parent fb3b5582ad
commit d4e5919a21
3 changed files with 18 additions and 3 deletions

View File

@ -66,6 +66,7 @@ void FileSystemHandler::fileSystemHandlerLoop() {
// This task will have a low priority and will run permanently in the background
// so we will just run in a permanent loop here and check file system
// messages permanently
opCounter++;
TaskFactory::instance()->delayTask(1000);
}
@ -78,7 +79,7 @@ void FileSystemHandler::fileSystemCheckup() {
(statusPair.first == sd::SdStatus::MOUNTED)) {
currentMountPrefix = SdCardManager::SD_0_MOUNT_POINT;
}
if((preferredSdCard == sd::SdCard::SLOT_1) and
else if((preferredSdCard == sd::SdCard::SLOT_1) and
(statusPair.second == sd::SdStatus::MOUNTED)) {
currentMountPrefix = SdCardManager::SD_1_MOUNT_POINT;
}
@ -90,8 +91,9 @@ void FileSystemHandler::fileSystemCheckup() {
else {
sdString = "1";
}
sif::warning << "FileSystemHandler::performOperation: Inconsistent" <<
" state detected. Preferred SD card is " << sdString <<
sif::warning << "FileSystemHandler::performOperation: "
"Inconsistent state detected" << std::endl;
sif::warning << "Preferred SD card is " << sdString <<
" but does not appear to be mounted. Attempting fix.." << std::endl;
// This function will appear to fix the inconsistent state
ReturnValue_t result = sdcMan->sanitizeState(&statusPair, preferredSdCard);