the sd stuff is evil..

This commit is contained in:
2023-03-10 02:05:51 +01:00
parent c8fe1b1359
commit 8b26d13070
18 changed files with 96 additions and 55 deletions

View File

@ -1,6 +1,7 @@
#include "PersistentLogTmStoreTask.h"
#include <fsfw/tasks/TaskFactory.h>
#include <fsfw/timemanager/Stopwatch.h>
PersistentLogTmStoreTask::PersistentLogTmStoreTask(object_id_t objectId, StorageManagerIF& ipcStore,
LogStores stores, VirtualChannel& channel,
@ -14,30 +15,30 @@ ReturnValue_t PersistentLogTmStoreTask::performOperation(uint8_t opCode) {
}
bool someonesBusy = false;
bool busy = false;
busy = handleOneStore(stores.okStore);
busy = handleOneStore(stores.okStore, tcHandlingCd);
if (busy) {
someonesBusy = true;
}
busy = handleOneStore(stores.notOkStore);
busy = handleOneStore(stores.notOkStore, tcHandlingCd);
if (busy) {
someonesBusy = true;
}
busy = handleOneStore(stores.miscStore);
busy = handleOneStore(stores.miscStore, tcHandlingCd);
if (busy) {
someonesBusy = true;
}
if (not someonesBusy) {
TaskFactory::delayTask(10);
TaskFactory::delayTask(40);
}
}
}
void PersistentLogTmStoreTask::initStoresIfPossible() {
bool PersistentLogTmStoreTask::initStoresIfPossible() {
if (sdcMan.isSdCardUsable(std::nullopt)) {
stores.okStore.initializeTmStore();
stores.miscStore.initializeTmStore();
stores.notOkStore.initializeTmStore();
storesInitialized = true;
return true;
}
return false;
}