diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index 77ccbcbd..e1891de7 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -25,7 +25,8 @@ CoreController::Chip CoreController::currentChip = Chip::NO_CHIP; CoreController::Copy CoreController::currentCopy = Copy::NO_COPY; CoreController::CoreController(object_id_t objectId): - ExtendedControllerBase(objectId, objects::NO_OBJECT, 5), opDivider(5) { + ExtendedControllerBase(objectId, objects::NO_OBJECT, 5), + opDivider(5) { ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; try { result = initWatchdogFifo(); @@ -91,16 +92,16 @@ ReturnValue_t CoreController::checkModeCommand(Mode_t mode, Submode_t submode, } ReturnValue_t CoreController::initSdCardBlocking() { -#if Q7S_SD_CARD_CONFIG == Q7S_SD_NONE - sif::info << "No SD card initialization will be performed" << std::endl; - return HasReturnvaluesIF::RETURN_OK; -#else // Create update status file ReturnValue_t result = sdcMan->updateSdCardStateFile(); if(result != HasReturnvaluesIF::RETURN_OK) { sif::warning << "CoreController::initialize: Updating SD card state file failed" << std::endl; } +#if Q7S_SD_CARD_CONFIG == Q7S_SD_NONE + sif::info << "No SD card initialization will be performed" << std::endl; + return HasReturnvaluesIF::RETURN_OK; +#else result = sdcMan->getSdCardActiveStatus(sdInfo.currentState); if(result != HasReturnvaluesIF::RETURN_OK) { @@ -139,22 +140,22 @@ ReturnValue_t CoreController::sdStateMachine() { } if(sdInfo.state == SdStates::START) { -#if Q7S_SD_CARD_CONFIG == Q7S_SD_NONE - sif::info << "No SD card initialization will be performed" << std::endl; - sdInfo.state = SdStates::IDLE; - sdInfo.initFinished = true; - return result; -#else // Init will be performed by separate function - if(not BLOCKING_SD_INIT) { + if(BLOCKING_SD_INIT) { sdInfo.state = SdStates::IDLE; sdInfo.initFinished = true; return result; } + else { + // Still update SD state file +#if Q7S_SD_CARD_CONFIG == Q7S_SD_NONE + sdInfo.state = SdStates::UPDATE_INFO; +#else + sdInfo.cycleCount = 0; + sdInfo.commandExecuted = false; + sdInfo.state = SdStates::GET_INFO; #endif - sdInfo.cycleCount = 0; - sdInfo.commandExecuted = false; - sdInfo.state = SdStates::GET_INFO; + } } // This lambda checks the non-blocking operation and assigns the new state on success. @@ -502,7 +503,7 @@ ReturnValue_t CoreController::sdCardSetup(sd::SdCard sdCard, sd::SdState targetS else { sif::warning << "CoreController::sdCardSetup: Invalid state for this call" << std::endl; } -return HasReturnvaluesIF::RETURN_OK; + return HasReturnvaluesIF::RETURN_OK; }