#include #include #include PersistentSingleTmStoreTask::PersistentSingleTmStoreTask( object_id_t objectId, StorageManagerIF& ipcStore, PersistentTmStoreWithTmQueue& tmStore, VirtualChannel& channel, Event eventIfDumpDone, SdCardMountedIF& sdcMan) : TmStoreTaskBase(objectId, ipcStore, channel, sdcMan), storeWithQueue(tmStore), dumpContext(eventIfDumpDone) {} ReturnValue_t PersistentSingleTmStoreTask::performOperation(uint8_t opCode) { while (true) { // Delay done by the check if (not cyclicStoreCheck()) { continue; } bool busy = handleOneStore(storeWithQueue, dumpContext); if (not busy) { TaskFactory::delayTask(40); } else { if (fileHasSwapped and graceDelayDuringDumping.hasTimedOut()) { TaskFactory::delayTask(2); graceDelayDuringDumping.resetTimer(); } } } } bool PersistentSingleTmStoreTask::initStoresIfPossible() { if (sdcMan.isSdCardUsable(std::nullopt)) { storeWithQueue.initializeTmStore(); return true; } return false; }