From 5a9ff5a4912f87918390348c8caa54ea8a6afada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Mon, 30 Sep 2024 16:17:00 +0200 Subject: [PATCH] [SX1227x] fix DIO register mapping (#1246) --- src/modules/SX127x/SX127x.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/SX127x/SX127x.cpp b/src/modules/SX127x/SX127x.cpp index 94b278bd..036fce83 100644 --- a/src/modules/SX127x/SX127x.cpp +++ b/src/modules/SX127x/SX127x.cpp @@ -1400,7 +1400,7 @@ int16_t SX127x::setIrqFlags(uint32_t irq) { // DIO pin is unused, set the flag and configure it usedPinFlags |= (1UL << dioNum); - uint8_t addr = (dioNum > 3) ? RADIOLIB_SX127X_REG_DIO_MAPPING_1 : RADIOLIB_SX127X_REG_DIO_MAPPING_2; + uint8_t addr = (dioNum > 3) ? RADIOLIB_SX127X_REG_DIO_MAPPING_2 : RADIOLIB_SX127X_REG_DIO_MAPPING_1; uint8_t msb = 7 - 2*(dioNum % 4); state = this->mod->SPIsetRegValue(addr, regVal, msb, msb - 1); RADIOLIB_ASSERT(state);