2023-03-09 17:44:05 +01:00
|
|
|
#include "PersistentLogTmStoreTask.h"
|
2023-03-09 19:42:20 +01:00
|
|
|
|
|
|
|
#include <fsfw/tasks/TaskFactory.h>
|
|
|
|
|
|
|
|
PersistentLogTmStoreTask::PersistentLogTmStoreTask(object_id_t objectId, StorageManagerIF& ipcStore,
|
|
|
|
LogStores stores, VirtualChannel& channel)
|
|
|
|
: TmStoreTaskBase(objectId, ipcStore, channel), stores(stores) {}
|
|
|
|
|
|
|
|
ReturnValue_t PersistentLogTmStoreTask::performOperation(uint8_t opCode) {
|
|
|
|
while (true) {
|
|
|
|
bool someonesBusy = false;
|
|
|
|
bool busy = handleOneStore(stores.okStore);
|
|
|
|
if (busy) {
|
|
|
|
someonesBusy = true;
|
|
|
|
}
|
|
|
|
busy = handleOneStore(stores.okStore);
|
|
|
|
if (busy) {
|
|
|
|
someonesBusy = true;
|
|
|
|
}
|
|
|
|
busy = handleOneStore(stores.miscStore);
|
|
|
|
if (busy) {
|
|
|
|
someonesBusy = true;
|
|
|
|
}
|
|
|
|
if (not someonesBusy) {
|
|
|
|
TaskFactory::delayTask(5);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|