Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/mesh/RadioLibInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,17 @@ void RadioLibInterface::pollMissedIrqs()
if (isReceiving) {
checkRxDoneIrqFlag();
}
if (sendingPacket != NULL) {
checkTxDoneIrqFlag();
// The stuck-TX guard in canSendImmediately only runs when the queue
// gets new packets. If the queue is empty, a wedged radio sits
// forever — fire the same reboot path here so it always trips.
if (!Throttle::isWithinTimespanMs(lastTxStart, 60000) && rebootAtMsec == 0) {
LOG_ERROR("Hardware Failure! TX stuck for more than 60s (poll)");
RECORD_CRITICALERROR(meshtastic_CriticalErrorCode_TRANSMIT_FAILED);
rebootAtMsec = lastTxStart + 65000;
}
}
}

void RadioLibInterface::resetAGC()
Expand All @@ -570,6 +581,14 @@ void RadioLibInterface::checkRxDoneIrqFlag()
}
}

void RadioLibInterface::checkTxDoneIrqFlag()
{
if (iface->checkIrq(RADIOLIB_IRQ_TX_DONE)) {
LOG_WARN("caught missed TX_DONE");
notify(ISR_TX, true);
}
}

void RadioLibInterface::configHardwareForSend()
{
powerMon->setState(meshtastic_PowerMon_State_Lora_TXOn);
Expand Down
1 change: 1 addition & 0 deletions src/mesh/RadioLibInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,4 +293,5 @@ class RadioLibInterface : public RadioInterface, protected concurrency::Notified
bool removePendingTXPacket(NodeNum from, PacketId id, uint32_t hop_limit_lt) override;

void checkRxDoneIrqFlag();
void checkTxDoneIrqFlag();
};
Loading