From fc494adda5cc9b6322cc7d75028a1c078a056cf1 Mon Sep 17 00:00:00 2001 From: sh123 Date: Fri, 22 Oct 2021 21:30:09 +0300 Subject: [PATCH] Set USE_RADIOLIB by default --- esp32_loraprs.ino | 6 ------ loraprs_service.cpp | 7 ++++++- loraprs_service.h | 6 ++++++ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/esp32_loraprs.ino b/esp32_loraprs.ino index c6c45be..77f1937 100644 --- a/esp32_loraprs.ino +++ b/esp32_loraprs.ino @@ -15,12 +15,6 @@ #pragma message("Configured for server mode") #endif -// When USE_RADIOLIB is defined then RadioLib will be used, otherwise arduino-LoRa will be used -// When using RadioLib, default module is SX1278, if you are using -// different module then update loraprs_service.h and loraprs_service.cpp -// search for SX1278 and replace with your module name - -//#define USE_RADIOLIB #include "loraprs_service.h" void initializeConfig(LoraPrs::Config &cfg) { diff --git a/loraprs_service.cpp b/loraprs_service.cpp index 7cae6b2..05e71a4 100644 --- a/loraprs_service.cpp +++ b/loraprs_service.cpp @@ -26,6 +26,11 @@ Service::Service() void Service::setup(const Config &conf) { +#ifdef USE_RADIOLIB + Serial.println("Built with RadioLib library"); +#else + Serial.println("Built with arudino-LoRa library"); +#endif config_ = conf; previousBeaconMs_ = 0; @@ -273,7 +278,7 @@ void Service::loop() bool Service::isLoraRxBusy() { #ifdef USE_RADIOLIB - return cfg_.LoraUseCad && (radio_->getModemStatus() & 0x01); // SX1278_STATUS_SIG_DETECT + return config_.LoraUseCad && (radio_->getModemStatus() & 0x01); // SX1278_STATUS_SIG_DETECT #else return false; #endif diff --git a/loraprs_service.h b/loraprs_service.h index f8a7c1e..89e9fa9 100644 --- a/loraprs_service.h +++ b/loraprs_service.h @@ -4,6 +4,12 @@ #include #include +// When USE_RADIOLIB is defined then RadioLib will be used, otherwise arduino-LoRa will be used +// When using RadioLib, default module is SX1278, if you are using +// different module then update loraprs_service.h and loraprs_service.cpp +// search for SX1278 and replace with your module name +#define USE_RADIOLIB + #ifdef USE_RADIOLIB #include #pragma message("Using RadioLib")