added missing store initialization code
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit

This commit is contained in:
2023-03-09 20:16:00 +01:00
parent e6aa582fcb
commit d50cbe9e5b
8 changed files with 82 additions and 22 deletions

View File

@ -3,20 +3,26 @@
#include <fsfw/tasks/TaskFactory.h>
PersistentLogTmStoreTask::PersistentLogTmStoreTask(object_id_t objectId, StorageManagerIF& ipcStore,
LogStores stores, VirtualChannel& channel)
: TmStoreTaskBase(objectId, ipcStore, channel), stores(stores) {}
LogStores stores, VirtualChannel& channel,
SdCardMountedIF& sdcMan)
: TmStoreTaskBase(objectId, ipcStore, channel, sdcMan), stores(stores) {}
ReturnValue_t PersistentLogTmStoreTask::performOperation(uint8_t opCode) {
while (true) {
bool someonesBusy = false;
bool busy = handleOneStore(stores.okStore);
if (busy) {
someonesBusy = true;
if (not cyclicStoreCheck()) {
continue;
}
bool someonesBusy = false;
bool busy = false;
busy = handleOneStore(stores.okStore);
if (busy) {
someonesBusy = true;
}
busy = handleOneStore(stores.notOkStore);
if (busy) {
someonesBusy = true;
}
busy = handleOneStore(stores.miscStore);
if (busy) {
someonesBusy = true;
@ -26,3 +32,12 @@ ReturnValue_t PersistentLogTmStoreTask::performOperation(uint8_t opCode) {
}
}
}
void PersistentLogTmStoreTask::initStoresIfPossible() {
if (sdcMan.isSdCardUsable(std::nullopt)) {
stores.okStore.initializeTmStore();
stores.miscStore.initializeTmStore();
stores.notOkStore.initializeTmStore();
storesInitialized = true;
}
}