some tweaks for busy handling #500
@ -44,7 +44,9 @@ void PapbVcInterface::endPacketTransfer() { *vcBaseReg = CONFIG_END; }
|
||||
ReturnValue_t PapbVcInterface::pollPapbBusySignal() const {
|
||||
gpio::Levels papbBusyState = gpio::Levels::LOW;
|
||||
ReturnValue_t result = returnvalue::OK;
|
||||
uint32_t busyIdx = 0;
|
||||
|
||||
while (true) {
|
||||
/** Check if PAPB interface is ready to receive data */
|
||||
result = gpioComIF->readGpio(papbBusyId, papbBusyState);
|
||||
if (result != returnvalue::OK) {
|
||||
@ -52,9 +54,14 @@ ReturnValue_t PapbVcInterface::pollPapbBusySignal() const {
|
||||
<< std::endl;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
if (papbBusyState == gpio::Levels::LOW) {
|
||||
if (papbBusyState == gpio::Levels::HIGH) {
|
||||
return returnvalue::OK;
|
||||
}
|
||||
if (busyIdx == 100) {
|
||||
return PAPB_BUSY;
|
||||
}
|
||||
busyIdx++;
|
||||
}
|
||||
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
@ -11,6 +11,9 @@ ReturnValue_t LiveTmTask::performOperation(uint8_t opCode) {
|
||||
while (true) {
|
||||
// The funnel tasks are scheduled here directly as well.
|
||||
ReturnValue_t result = channel.sendNextTm();
|
||||
if (result == DirectTmSinkIF::IS_BUSY) {
|
||||
sif::error << "Lost live TM, PAPB busy" << std::endl;
|
||||
}
|
||||
if (result == MessageQueueIF::EMPTY) {
|
||||
if (tmFunnelCd.hasTimedOut()) {
|
||||
pusFunnel.performOperation(0);
|
||||
|
@ -26,9 +26,12 @@ bool TmStoreTaskBase::handleOneStore(PersistentTmStoreWithTmQueue& store,
|
||||
if (store.getState() == PersistentTmStore::State::DUMPING) {
|
||||
size_t dumpedLen = 0;
|
||||
bool fileHasSwapped;
|
||||
if (not channel.isBusy()) {
|
||||
// if (not channel.isBusy()) {
|
||||
tmSinkBusyCd.resetTimer();
|
||||
result = store.dumpNextPacket(channel, dumpedLen, fileHasSwapped);
|
||||
if (result == DirectTmSinkIF::IS_BUSY) {
|
||||
sif::warning << "PersistentTmStore: PAPB was too busy for dump" << std::endl;
|
||||
}
|
||||
if ((result == PersistentTmStore::DUMP_DONE or result == returnvalue::OK) and dumpedLen > 0) {
|
||||
dumpContext.dumpedBytes += dumpedLen;
|
||||
dumpContext.numberOfDumpedPackets += 1;
|
||||
@ -43,7 +46,7 @@ bool TmStoreTaskBase::handleOneStore(PersistentTmStoreWithTmQueue& store,
|
||||
} else if (result == returnvalue::OK) {
|
||||
dumpsPerformed = true;
|
||||
}
|
||||
}
|
||||
//}
|
||||
if (cancelDumpCd.hasTimedOut() or tmSinkBusyCd.hasTimedOut()) {
|
||||
triggerEvent(persTmStore::DUMP_WAS_CANCELLED, store.getObjectId());
|
||||
store.cancelDump();
|
||||
|
@ -36,7 +36,10 @@ ReturnValue_t VirtualChannelWithQueue::sendNextTm() {
|
||||
return result;
|
||||
}
|
||||
|
||||
write(data, size);
|
||||
ReturnValue_t result = write(data, size);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
tmStore.deleteData(storeId);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
|
Loading…
Reference in New Issue
Block a user