From bc72f59abbc1bd56a6684b16e9e05b83603aba20 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 27 Mar 2023 21:46:12 +0200 Subject: [PATCH] now its just trying things out --- mission/tmtc/PersistentSingleTmStoreTask.cpp | 12 +++++++----- mission/tmtc/TmStoreTaskBase.h | 6 ++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/mission/tmtc/PersistentSingleTmStoreTask.cpp b/mission/tmtc/PersistentSingleTmStoreTask.cpp index 8b7272c4..2584d975 100644 --- a/mission/tmtc/PersistentSingleTmStoreTask.cpp +++ b/mission/tmtc/PersistentSingleTmStoreTask.cpp @@ -20,13 +20,15 @@ ReturnValue_t PersistentSingleTmStoreTask::performOperation(uint8_t opCode) { if (not busy) { TaskFactory::delayTask(100); } else if (dumpContext.vcBusyDuringDump) { - TaskFactory::delayTask(10); + TaskFactory::delayTask(20); } else if (fileHasSwapped) { - TaskFactory::delayTask(10); - } else if (dumpContext.packetWasDumped and dumpContext.numberOfDumpedPackets % 50 == 0) { - TaskFactory::delayTask(10); + TaskFactory::delayTask(20); + } else if (dumpContext.packetWasDumped and + dumpContext.numberOfDumpedPackets - dumpContext.bytesDumpedAtLastDelay >= 2048) { + dumpContext.bytesDumpedAtLastDelay = dumpContext.dumpedBytes; + TaskFactory::delayTask(20); } else { - // TaskFactory::delayTask(5); + TaskFactory::delayTask(10); } // else if(dumpContext.numberOfDumpedPackets % 20 == 0) { // Manual load management because I don't know what the scheduler is doing.. diff --git a/mission/tmtc/TmStoreTaskBase.h b/mission/tmtc/TmStoreTaskBase.h index d911c343..780210b8 100644 --- a/mission/tmtc/TmStoreTaskBase.h +++ b/mission/tmtc/TmStoreTaskBase.h @@ -14,11 +14,13 @@ class TmStoreTaskBase : public SystemObject { dumpedBytes = 0; vcBusyDuringDump = false; packetWasDumped = false; + bytesDumpedAtLastDelay = 0; ptmeBusyCounter = 0; } const Event eventIfDone; - uint32_t numberOfDumpedPackets = 0; - uint32_t dumpedBytes = 0; + size_t numberOfDumpedPackets = 0; + size_t bytesDumpedAtLastDelay = 0; + size_t dumpedBytes = 0; uint32_t ptmeBusyCounter = 0; bool packetWasDumped = false; bool vcBusyDuringDump = false;