From 54fe98c93856723da8983a569a80131aa971a371 Mon Sep 17 00:00:00 2001 From: "Zachary J. Fields" Date: Fri, 9 Feb 2024 11:28:51 -0600 Subject: [PATCH] chore: LoRa to use BOARD_HAS_LORA Follows precedent established by Wi-Fi implementation. --- src/Arduino_LoRaConnectionHandler.cpp | 6 +++--- src/Arduino_LoRaConnectionHandler.h | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Arduino_LoRaConnectionHandler.cpp b/src/Arduino_LoRaConnectionHandler.cpp index fa06e595..cf1deaf0 100644 --- a/src/Arduino_LoRaConnectionHandler.cpp +++ b/src/Arduino_LoRaConnectionHandler.cpp @@ -19,10 +19,10 @@ INCLUDE ******************************************************************************/ -#if defined(ARDUINO_SAMD_MKRWAN1300) || defined(ARDUINO_SAMD_MKRWAN1310) /* Only compile if the board has LoRa */ - #include "Arduino_LoRaConnectionHandler.h" +#if defined(BOARD_HAS_LORA) /* Only compile if the board has LoRa */ + /****************************************************************************** TYPEDEF ******************************************************************************/ @@ -106,7 +106,7 @@ NetworkConnectionState LoRaConnectionHandler::update_handleInit() { Debug.print(DBG_ERROR, F("Something went wrong; are you indoor? Move near a window, then reset and retry.")); return NetworkConnectionState::ERROR; - } + } // Set channelmask based on configuration if (_channelMask) { _modem.sendMask(_channelMask); diff --git a/src/Arduino_LoRaConnectionHandler.h b/src/Arduino_LoRaConnectionHandler.h index 2d76cb34..aa769ab5 100644 --- a/src/Arduino_LoRaConnectionHandler.h +++ b/src/Arduino_LoRaConnectionHandler.h @@ -24,6 +24,8 @@ #include "Arduino_ConnectionHandler.h" +#ifdef BOARD_HAS_LORA /* Only compile if the board has LoRa */ + /****************************************************************************** CLASS DECLARATION ******************************************************************************/ @@ -72,4 +74,6 @@ class LoRaConnectionHandler : public ConnectionHandler LoRaModem _modem; }; +#endif /* #ifdef BOARD_HAS_LORA */ + #endif /* ARDUINO_LORA_CONNECTION_HANDLER_H_ */