From b1d8850d92e966862c27290bf91fb46eaed213af Mon Sep 17 00:00:00 2001 From: Alistair Francis Date: Sat, 2 Nov 2024 21:38:43 +1000 Subject: [PATCH] hal: Tock: Re-enable pin after detaching interrupt (#1308) The Tock libtock_lora_phy_gpio_disable_interrupt() syscall will disable interrupts for the pin, but also put the pin into a disabled low power state. This isn't what RadioLib expects and casues subsequent LoRaWAN transfers to fail [1]. So after we disable interrupts and send the pin to low power let's re-enable inputs as RadioLib expects. 1: https://github.com/jgromes/RadioLib/discussions/1303 Signed-off-by: Alistair Francis --- src/hal/Tock/libtockHal.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hal/Tock/libtockHal.h b/src/hal/Tock/libtockHal.h index 7ae8bf2a..9d597fd1 100644 --- a/src/hal/Tock/libtockHal.h +++ b/src/hal/Tock/libtockHal.h @@ -154,6 +154,7 @@ class TockHal : public RadioLibHal { gpio_funcs[interruptNum - 1] = NULL; libtock_lora_phy_gpio_disable_interrupt(interruptNum); + libtock_lora_phy_gpio_enable_input(interruptNum, libtock_pull_down); } void delay(unsigned long ms) override {