some bugfixes, seems to work now
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
This commit is contained in:
parent
aa43912279
commit
2df556c5be
@ -489,6 +489,8 @@ ReturnValue_t CoreController::sdStateMachine() {
|
|||||||
// Do not skip cycles here, would mess up the state machine. We skip the cycles after
|
// Do not skip cycles here, would mess up the state machine. We skip the cycles after
|
||||||
// the SD card was switched on.
|
// the SD card was switched on.
|
||||||
skipCycles = false;
|
skipCycles = false;
|
||||||
|
// Remain on the current state.
|
||||||
|
tgtState = sdFsmState;
|
||||||
} else if (sdInfo.activeState == sd::SdState::ON) {
|
} else if (sdInfo.activeState == sd::SdState::ON) {
|
||||||
// We can do the delay before mounting where applicable.
|
// We can do the delay before mounting where applicable.
|
||||||
tgtState = SdStates::MOUNT_SELF;
|
tgtState = SdStates::MOUNT_SELF;
|
||||||
@ -515,7 +517,6 @@ ReturnValue_t CoreController::sdStateMachine() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (sdFsmState == SdStates::SKIP_TWO_CYCLES_IF_SD_LOCKED) {
|
if (sdFsmState == SdStates::SKIP_TWO_CYCLES_IF_SD_LOCKED) {
|
||||||
sif::debug << "skipping cycle.." << std::endl;
|
|
||||||
sdInfo.skippedCyclesCount++;
|
sdInfo.skippedCyclesCount++;
|
||||||
// Count to three because this branch will run in the same FSM cycle.
|
// Count to three because this branch will run in the same FSM cycle.
|
||||||
if (sdInfo.skippedCyclesCount == 3) {
|
if (sdInfo.skippedCyclesCount == 3) {
|
||||||
@ -575,6 +576,11 @@ ReturnValue_t CoreController::sdStateMachine() {
|
|||||||
"Switching off other SD card")) {
|
"Switching off other SD card")) {
|
||||||
sdInfo.otherState = sd::SdState::OFF;
|
sdInfo.otherState = sd::SdState::OFF;
|
||||||
currentStateSetter(sdInfo.other, 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) {
|
} else if (sdInfo.cfgMode == SdCfgMode::HOT_REDUNDANT) {
|
||||||
@ -586,6 +592,11 @@ ReturnValue_t CoreController::sdStateMachine() {
|
|||||||
"Switching on other SD card")) {
|
"Switching on other SD card")) {
|
||||||
sdInfo.otherState = sd::SdState::ON;
|
sdInfo.otherState = sd::SdState::ON;
|
||||||
currentStateSetter(sdInfo.other, 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -338,6 +338,8 @@ ReturnValue_t PersistentTmStore::createMostRecentFile(std::optional<uint8_t> suf
|
|||||||
ReturnValue_t PersistentTmStore::initializeTmStore() {
|
ReturnValue_t PersistentTmStore::initializeTmStore() {
|
||||||
Clock::getClock_timeval(¤tTv);
|
Clock::getClock_timeval(¤tTv);
|
||||||
updateBaseDir();
|
updateBaseDir();
|
||||||
|
// Reset active file, base directory might have changed.
|
||||||
|
activeFile = std::nullopt;
|
||||||
return assignAndOrCreateMostRecentFile();
|
return assignAndOrCreateMostRecentFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user