From 58940084958f9291e93a55cb9fb8c963c4ef8c7a Mon Sep 17 00:00:00 2001 From: Jye Date: Tue, 28 Dec 2021 17:35:03 +1000 Subject: [PATCH] makes GPIO_PIN_RST optional for the sx1276 --- src/lib/SX127xDriver/SX127xHal.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/SX127xDriver/SX127xHal.cpp b/src/lib/SX127xDriver/SX127xHal.cpp index 591d3c84..4d01c97f 100644 --- a/src/lib/SX127xDriver/SX127xHal.cpp +++ b/src/lib/SX127xDriver/SX127xHal.cpp @@ -65,15 +65,18 @@ void SX127xHal::init() #endif pinMode(GPIO_PIN_NSS, OUTPUT); - pinMode(GPIO_PIN_RST, OUTPUT); pinMode(GPIO_PIN_DIO0, INPUT); digitalWrite(GPIO_PIN_NSS, HIGH); +#if defined(GPIO_PIN_RST) + pinMode(GPIO_PIN_RST, OUTPUT); + delay(100); digitalWrite(GPIO_PIN_RST, 0); delay(100); pinMode(GPIO_PIN_RST, INPUT); // leave floating +#endif attachInterrupt(digitalPinToInterrupt(GPIO_PIN_DIO0), dioISR, RISING); } -- 2.11.4.GIT