From ef5ee1f08949ff56f13c3156a7e6d40da16592d4 Mon Sep 17 00:00:00 2001 From: jgromes Date: Sun, 25 Aug 2024 18:12:03 +0200 Subject: [PATCH] [LR11x0] Rework generic IRQ to allow multiple flags --- src/modules/LR11x0/LR11x0.cpp | 11 ++--------- src/modules/LR11x0/LR11x0.h | 8 -------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/src/modules/LR11x0/LR11x0.cpp b/src/modules/LR11x0/LR11x0.cpp index f4b2e3d7..9bab97ee 100644 --- a/src/modules/LR11x0/LR11x0.cpp +++ b/src/modules/LR11x0/LR11x0.cpp @@ -480,10 +480,9 @@ int16_t LR11x0::startReceive(uint32_t timeout, uint32_t irqFlags, uint32_t irqMa // set DIO mapping uint32_t irq = irqFlags; if(timeout != RADIOLIB_LR11X0_RX_TIMEOUT_INF) { - irq |= RADIOLIB_LR11X0_IRQ_TIMEOUT; + irq |= (1UL << RADIOLIB_IRQ_TIMEOUT); } - - state = setDioIrqParams(irq); + state = setDioIrqParams(getIrqMapped(irq)); RADIOLIB_ASSERT(state); // clear interrupt flags @@ -1353,12 +1352,6 @@ RadioLibTime_t LR11x0::calculateRxTimeout(RadioLibTime_t timeoutUs) { return(timeout); } -int16_t LR11x0::irqRxDoneRxTimeout(uint32_t &irqFlags, uint32_t &irqMask) { - irqFlags = RADIOLIB_LR11X0_IRQ_RX_DONE | RADIOLIB_LR11X0_IRQ_TIMEOUT; // flags that can appear in the IRQ register - irqMask = irqFlags; // on LR11x0, these are the same - return(RADIOLIB_ERR_NONE); -} - uint32_t LR11x0::getIrqFlags() { return((uint32_t)this->getIrqStatus()); } diff --git a/src/modules/LR11x0/LR11x0.h b/src/modules/LR11x0/LR11x0.h index 95c7c363..d7cf2d2a 100644 --- a/src/modules/LR11x0/LR11x0.h +++ b/src/modules/LR11x0/LR11x0.h @@ -1216,14 +1216,6 @@ class LR11x0: public PhysicalLayer { */ RadioLibTime_t calculateRxTimeout(RadioLibTime_t timeoutUs) override; - /*! - \brief Create the flags that make up RxDone and RxTimeout used for receiving downlinks - \param irqFlags The flags for which IRQs must be triggered - \param irqMask Mask indicating which IRQ triggers a DIO - \returns \ref status_codes - */ - int16_t irqRxDoneRxTimeout(uint32_t &irqFlags, uint32_t &irqMask) override; - /*! \brief Read currently active IRQ flags. \returns IRQ flags.