Files
meshcore-tth/examples
tthandClaude Opus 5 b9848fe79a feat(radio): DIO1-less operation + pin diagnostics, to salvage bench-board
bench-board died 29. 7. 2026 to a breadboard short that put GND on D1 (= DIO1)
and 5 V on D0. Signature: `sent 0` with tx_timeout climbing WHILE A WITNESS
HEARD THE FRAMES, plus `recv 0` at strong signal -- the radio works, the
interrupt line does not. setPacketReceivedAction() is the only thing that
ever sets STATE_INT_READY, so a dead line means nothing is ever picked up.

LORA_POLL_IRQ reads completion from the chip's IRQ status register over SPI
instead. The chip latches those events regardless of whether they are mapped
out to a DIO pin, so this bypasses the whole line and therefore works no
matter WHICH end of it broke. Rewiring DIO1 to a spare GPIO only helps if the
broken end is the MCU's input pad -- and that is the less likely end, because
grounding an input cannot damage the input, it stresses whatever drives the
net. Polling is strictly stronger: if it does not revive the node, no wire
will either. Cost is one extra SPI read per Dispatcher pass, next to the
isReceivingPacket() read already in that path.

getIrqFlags() returns the RAW chip register (SX126x bits, not RadioLib's
generic RADIOLIB_IRQ_* indices), so the mask comes from a new virtual
irqDoneMask() that only the chip-specific wrapper can fill in.

PIN_DIAG answers "which end?" without a multimeter:

  - boot-time pull-up/pull-down sweep of every header pin, placed BEFORE
    radio_init() because that halt()s when the radio does not answer -- so it
    is the only diagnostic that still runs with the module unplugged, which is
    also the only state where D1's result means anything (attached, the SX1262
    drives DIO1 low and a healthy board reads 0 too). The internal pull is the
    ohmmeter. It cannot see a lifted pad -- the resistor is on the die -- hence
    the optional PIN_DIAG_LOOP_A/B jumper loopback, which drives from outside
    and reads while pulling AGAINST the driver.

  - `dio1` has the radio assert DIO1 via a 1-byte transmit and compares the
    IRQ status register against the actual pin level. Where they disagree is
    where the break is.

All of it is behind #ifdef; a build without the flags is unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-04 21:32:58 +02:00
..
2026-06-06 21:09:38 +10:00
2026-06-06 21:09:38 +10:00