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_ */