From 57d668824023c9b460a3d4183b66ecab825d10b0 Mon Sep 17 00:00:00 2001 From: Zindello Date: Mon, 1 Jun 2026 17:09:30 +1000 Subject: [PATCH] fix: clear IRQ register after RX restore to prevent gpiod polling deafness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When two back-to-back packets arrive within the gpiod polling window (20ms), the IRQ line stays HIGH after the first interrupt is handled. The polling thread never sees a LOW→HIGH transition for the second event, so _handle_interrupt is never called and the radio goes deaf indefinitely. Calling clearIrqStatus(0xFFFF) immediately after request(RX_CONTINUOUS) forces DIO1 LOW, allowing the polling thread to detect the next real rising edge. Co-Authored-By: Claude Sonnet 4.6 --- src/pymc_core/hardware/sx1262_wrapper.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pymc_core/hardware/sx1262_wrapper.py b/src/pymc_core/hardware/sx1262_wrapper.py index 842bc25..1ec3748 100644 --- a/src/pymc_core/hardware/sx1262_wrapper.py +++ b/src/pymc_core/hardware/sx1262_wrapper.py @@ -517,6 +517,7 @@ async def _rx_irq_background_task(self): if not self._tx_lock.locked(): try: self.lora.request(self.lora.RX_CONTINUOUS) + self.lora.clearIrqStatus(0xFFFF) await asyncio.sleep(self.RADIO_TIMING_DELAY) logger.debug( f"[RX] Restored RX continuous mode after IRQ 0x{irqStat:04X}"