From ebdec7f3e093f44e276e72726db8e0b37a271bad Mon Sep 17 00:00:00 2001 From: "jacob.eva" Date: Tue, 21 May 2024 17:15:21 +0100 Subject: [PATCH] Remove support for no busy pin set --- sx126x.cpp | 12 +++++------- sx126x.h | 5 +++-- sx128x.cpp | 12 +++++------- sx128x.h | 4 ++-- 4 files changed, 15 insertions(+), 18 deletions(-) diff --git a/sx126x.cpp b/sx126x.cpp index 2ddd8ee..9fd613e 100644 --- a/sx126x.cpp +++ b/sx126x.cpp @@ -202,14 +202,12 @@ void sx126x::loraMode() { void sx126x::waitOnBusy() { unsigned long time = millis(); - if (_busy != -1) { - while (digitalRead(_busy) == HIGH) - { - if (millis() >= (time + 100)) { - break; - } - // do nothing + while (digitalRead(_busy) == HIGH) + { + if (millis() >= (time + 100)) { + break; } + // do nothing } } diff --git a/sx126x.h b/sx126x.h index 5e0ff4d..c3b0668 100644 --- a/sx126x.h +++ b/sx126x.h @@ -9,14 +9,14 @@ #include #include -#include "Modem.h" +#include "Interfaces.h" #define LORA_DEFAULT_SS_PIN 10 #define LORA_DEFAULT_RESET_PIN 9 #define LORA_DEFAULT_DIO0_PIN 2 #define LORA_DEFAULT_RXEN_PIN -1 #define LORA_DEFAULT_TXEN_PIN -1 -#define LORA_DEFAULT_BUSY_PIN -1 +#define LORA_DEFAULT_BUSY_PIN 11 #define PA_OUTPUT_RFO_PIN 0 #define PA_OUTPUT_PA_BOOST_PIN 1 @@ -139,6 +139,7 @@ private: uint8_t _packet[255]; bool _preinit_done; void (*_onReceive)(int); + bool _tcxo; }; extern sx126x sx126x_modem; diff --git a/sx128x.cpp b/sx128x.cpp index c632697..9c4a249 100644 --- a/sx128x.cpp +++ b/sx128x.cpp @@ -206,14 +206,12 @@ void sx128x::loraMode() { void sx128x::waitOnBusy() { unsigned long time = millis(); - if (_busy != -1) { - while (digitalRead(_busy) == HIGH) - { - if (millis() >= (time + 100)) { - break; - } - // do nothing + while (digitalRead(_busy) == HIGH) + { + if (millis() >= (time + 100)) { + break; } + // do nothing } } diff --git a/sx128x.h b/sx128x.h index 213fc48..ad76d51 100644 --- a/sx128x.h +++ b/sx128x.h @@ -9,14 +9,14 @@ #include #include -#include "Modem.h" +#include "Interfaces.h" #define LORA_DEFAULT_SS_PIN 10 #define LORA_DEFAULT_RESET_PIN 9 #define LORA_DEFAULT_DIO0_PIN 2 #define LORA_DEFAULT_RXEN_PIN -1 #define LORA_DEFAULT_TXEN_PIN -1 -#define LORA_DEFAULT_BUSY_PIN -1 +#define LORA_DEFAULT_BUSY_PIN 11 #define PA_OUTPUT_RFO_PIN 0 #define PA_OUTPUT_PA_BOOST_PIN 1