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,4 +1,5 @@
#include <fsfw/tasks/TaskFactory.h>
#include <fsfw/timemanager/Stopwatch.h>
#include <mission/tmtc/PersistentSingleTmStoreTask.h>
PersistentSingleTmStoreTask::PersistentSingleTmStoreTask(object_id_t objectId,
@ -10,14 +11,21 @@ PersistentSingleTmStoreTask::PersistentSingleTmStoreTask(object_id_t objectId,
ReturnValue_t PersistentSingleTmStoreTask::performOperation(uint8_t opCode) {
while (true) {
// Delay done by the check
if (not cyclicStoreCheck()) {
continue;
}
bool busy = handleOneStore(storeWithQueue);
bool busy = handleOneStore(storeWithQueue, tcHandlingCd);
if (not busy) {
TaskFactory::delayTask(10);
TaskFactory::delayTask(40);
}
}
}
void PersistentSingleTmStoreTask::initStoresIfPossible() {}
bool PersistentSingleTmStoreTask::initStoresIfPossible() {
if (sdcMan.isSdCardUsable(std::nullopt)) {
storeWithQueue.initializeTmStore();
return true;
}
return false;
}