last know working cfg for slow downlink
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
This commit is contained in:
parent
9613d4aa51
commit
534945cfec
@ -58,7 +58,7 @@ ReturnValue_t PapbVcInterface::pollPapbBusySignal(uint32_t maxPollRetries) const
|
|||||||
gpio::Levels papbBusyState = gpio::Levels::LOW;
|
gpio::Levels papbBusyState = gpio::Levels::LOW;
|
||||||
ReturnValue_t result;
|
ReturnValue_t result;
|
||||||
uint32_t busyIdx = 0;
|
uint32_t busyIdx = 0;
|
||||||
nextDelay.tv_nsec = 1000;
|
nextDelay.tv_nsec = 0;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
/** Check if PAPB interface is ready to receive data */
|
/** Check if PAPB interface is ready to receive data */
|
||||||
@ -80,7 +80,9 @@ ReturnValue_t PapbVcInterface::pollPapbBusySignal(uint32_t maxPollRetries) const
|
|||||||
// Ignore signal handling here for now.
|
// Ignore signal handling here for now.
|
||||||
nanosleep(&nextDelay, &remDelay);
|
nanosleep(&nextDelay, &remDelay);
|
||||||
// Adaptive delay.
|
// Adaptive delay.
|
||||||
if (nextDelay.tv_nsec * 2 <= MAX_DELAY_PAPB_POLLING_NS) {
|
if(nextDelay.tv_nsec == 0) {
|
||||||
|
nextDelay.tv_nsec = FIRST_NON_NULL_DELAY_NS;
|
||||||
|
} else if (nextDelay.tv_nsec * 2 <= MAX_DELAY_PAPB_POLLING_NS) {
|
||||||
nextDelay.tv_nsec *= 2;
|
nextDelay.tv_nsec *= 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,6 +76,7 @@ class PapbVcInterface : public VirtualChannelIF {
|
|||||||
*/
|
*/
|
||||||
static const int DATA_REG_OFFSET = 256;
|
static const int DATA_REG_OFFSET = 256;
|
||||||
|
|
||||||
|
static constexpr long int FIRST_NON_NULL_DELAY_NS = 1000;
|
||||||
static constexpr long int MAX_DELAY_PAPB_POLLING_NS = 4000;
|
static constexpr long int MAX_DELAY_PAPB_POLLING_NS = 4000;
|
||||||
|
|
||||||
LinuxLibgpioIF* gpioComIF = nullptr;
|
LinuxLibgpioIF* gpioComIF = nullptr;
|
||||||
@ -87,7 +88,7 @@ class PapbVcInterface : public VirtualChannelIF {
|
|||||||
|
|
||||||
std::string uioFile;
|
std::string uioFile;
|
||||||
int mapNum = 0;
|
int mapNum = 0;
|
||||||
mutable struct timespec nextDelay = {.tv_sec = 0, .tv_nsec = 1000};
|
mutable struct timespec nextDelay = {.tv_sec = 0, .tv_nsec = 0};
|
||||||
mutable struct timespec remDelay;
|
mutable struct timespec remDelay;
|
||||||
|
|
||||||
volatile uint32_t* vcBaseReg = nullptr;
|
volatile uint32_t* vcBaseReg = nullptr;
|
||||||
|
@ -11,6 +11,7 @@ PersistentSingleTmStoreTask::PersistentSingleTmStoreTask(
|
|||||||
dumpContext(eventIfDumpDone) {}
|
dumpContext(eventIfDumpDone) {}
|
||||||
|
|
||||||
ReturnValue_t PersistentSingleTmStoreTask::performOperation(uint8_t opCode) {
|
ReturnValue_t PersistentSingleTmStoreTask::performOperation(uint8_t opCode) {
|
||||||
|
ReturnValue_t result = returnvalue::OK;
|
||||||
while (true) {
|
while (true) {
|
||||||
// Delay done by the check
|
// Delay done by the check
|
||||||
if (not cyclicStoreCheck()) {
|
if (not cyclicStoreCheck()) {
|
||||||
@ -18,18 +19,19 @@ ReturnValue_t PersistentSingleTmStoreTask::performOperation(uint8_t opCode) {
|
|||||||
}
|
}
|
||||||
bool busy = handleOneStore(storeWithQueue, dumpContext);
|
bool busy = handleOneStore(storeWithQueue, dumpContext);
|
||||||
if (not busy) {
|
if (not busy) {
|
||||||
TaskFactory::delayTask(100);
|
result = TaskFactory::delayTask(100);
|
||||||
} else if (dumpContext.vcBusyDuringDump) {
|
} else if (dumpContext.vcBusyDuringDump) {
|
||||||
TaskFactory::delayTask(20);
|
result = TaskFactory::delayTask(10);
|
||||||
} else if (fileHasSwapped) {
|
|
||||||
TaskFactory::delayTask(20);
|
|
||||||
} else if (dumpContext.packetWasDumped and
|
} else if (dumpContext.packetWasDumped and
|
||||||
dumpContext.dumpedBytes - dumpContext.bytesDumpedAtLastDelay >= 2048) {
|
dumpContext.dumpedBytes - dumpContext.bytesDumpedAtLastDelay >= 2048) {
|
||||||
dumpContext.bytesDumpedAtLastDelay = dumpContext.dumpedBytes;
|
dumpContext.bytesDumpedAtLastDelay = dumpContext.dumpedBytes;
|
||||||
TaskFactory::delayTask(20);
|
result = TaskFactory::delayTask(10);
|
||||||
} else {
|
} else {
|
||||||
// TODO: Lower this as much as possible...
|
// TODO: Lower this as much as possible...
|
||||||
TaskFactory::delayTask(5);
|
result = TaskFactory::delayTask(10);
|
||||||
|
}
|
||||||
|
if(result != returnvalue::OK) {
|
||||||
|
sif::warning << "TmStoreTask: Delay failed" << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ bool TmStoreTaskBase::handleOneStore(PersistentTmStoreWithTmQueue& store,
|
|||||||
} else {
|
} else {
|
||||||
dumpContext.vcBusyDuringDump = true;
|
dumpContext.vcBusyDuringDump = true;
|
||||||
dumpContext.ptmeBusyCounter++;
|
dumpContext.ptmeBusyCounter++;
|
||||||
if (dumpContext.ptmeBusyCounter == 50) {
|
if (dumpContext.ptmeBusyCounter == 100) {
|
||||||
// If this happens, something is probably wrong.
|
// If this happens, something is probably wrong.
|
||||||
sif::warning << "PTME busy for longer period. Dumped length so far: "
|
sif::warning << "PTME busy for longer period. Dumped length so far: "
|
||||||
<< dumpContext.dumpedBytes << std::endl;
|
<< dumpContext.dumpedBytes << std::endl;
|
||||||
|
Loading…
Reference in New Issue
Block a user