tweaks for no-init variant
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
EIVE/eive-obsw/pipeline/head This commit looks good

This commit is contained in:
Robin Müller 2021-08-08 12:59:21 +02:00
parent 8cdb877df6
commit 02a837c964
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814

View File

@ -25,7 +25,8 @@ CoreController::Chip CoreController::currentChip = Chip::NO_CHIP;
CoreController::Copy CoreController::currentCopy = Copy::NO_COPY; CoreController::Copy CoreController::currentCopy = Copy::NO_COPY;
CoreController::CoreController(object_id_t objectId): 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; ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
try { try {
result = initWatchdogFifo(); result = initWatchdogFifo();
@ -91,16 +92,16 @@ ReturnValue_t CoreController::checkModeCommand(Mode_t mode, Submode_t submode,
} }
ReturnValue_t CoreController::initSdCardBlocking() { 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 // Create update status file
ReturnValue_t result = sdcMan->updateSdCardStateFile(); ReturnValue_t result = sdcMan->updateSdCardStateFile();
if(result != HasReturnvaluesIF::RETURN_OK) { if(result != HasReturnvaluesIF::RETURN_OK) {
sif::warning << "CoreController::initialize: Updating SD card state file failed" sif::warning << "CoreController::initialize: Updating SD card state file failed"
<< std::endl; << 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); result = sdcMan->getSdCardActiveStatus(sdInfo.currentState);
if(result != HasReturnvaluesIF::RETURN_OK) { if(result != HasReturnvaluesIF::RETURN_OK) {
@ -139,22 +140,22 @@ ReturnValue_t CoreController::sdStateMachine() {
} }
if(sdInfo.state == SdStates::START) { 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 // Init will be performed by separate function
if(not BLOCKING_SD_INIT) { if(BLOCKING_SD_INIT) {
sdInfo.state = SdStates::IDLE; sdInfo.state = SdStates::IDLE;
sdInfo.initFinished = true; sdInfo.initFinished = true;
return result; 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 #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. // 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 { else {
sif::warning << "CoreController::sdCardSetup: Invalid state for this call" << std::endl; sif::warning << "CoreController::sdCardSetup: Invalid state for this call" << std::endl;
} }
return HasReturnvaluesIF::RETURN_OK; return HasReturnvaluesIF::RETURN_OK;
} }