some bugfixes, seems to work now
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...

This commit is contained in:
Robin Müller 2023-04-08 17:46:54 +02:00
parent aa43912279
commit 2df556c5be
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
2 changed files with 14 additions and 1 deletions

View File

@ -489,6 +489,8 @@ ReturnValue_t CoreController::sdStateMachine() {
// Do not skip cycles here, would mess up the state machine. We skip the cycles after
// the SD card was switched on.
skipCycles = false;
// Remain on the current state.
tgtState = sdFsmState;
} else if (sdInfo.activeState == sd::SdState::ON) {
// We can do the delay before mounting where applicable.
tgtState = SdStates::MOUNT_SELF;
@ -515,7 +517,6 @@ ReturnValue_t CoreController::sdStateMachine() {
}
if (sdFsmState == SdStates::SKIP_TWO_CYCLES_IF_SD_LOCKED) {
sif::debug << "skipping cycle.." << std::endl;
sdInfo.skippedCyclesCount++;
// Count to three because this branch will run in the same FSM cycle.
if (sdInfo.skippedCyclesCount == 3) {
@ -575,6 +576,11 @@ ReturnValue_t CoreController::sdStateMachine() {
"Switching off other SD card")) {
sdInfo.otherState = sd::SdState::OFF;
currentStateSetter(sdInfo.other, sd::SdState::OFF);
} else {
// Continue.. avoid being stuck here..
sdFsmState = SdStates::SKIP_CYCLE_BEFORE_INFO_UPDATE;
sdInfo.otherState = sd::SdState::OFF;
currentStateSetter(sdInfo.other, sd::SdState::OFF);
}
}
} else if (sdInfo.cfgMode == SdCfgMode::HOT_REDUNDANT) {
@ -586,6 +592,11 @@ ReturnValue_t CoreController::sdStateMachine() {
"Switching on other SD card")) {
sdInfo.otherState = sd::SdState::ON;
currentStateSetter(sdInfo.other, sd::SdState::ON);
} else {
// Contnue.. avoid being stuck here.
sdFsmState = SdStates::MOUNT_UNMOUNT_OTHER;
sdInfo.otherState = sd::SdState::ON;
currentStateSetter(sdInfo.other, sd::SdState::ON);
}
}
}

View File

@ -338,6 +338,8 @@ ReturnValue_t PersistentTmStore::createMostRecentFile(std::optional<uint8_t> suf
ReturnValue_t PersistentTmStore::initializeTmStore() {
Clock::getClock_timeval(&currentTv);
updateBaseDir();
// Reset active file, base directory might have changed.
activeFile = std::nullopt;
return assignAndOrCreateMostRecentFile();
}