From 4f70c6717546327faa78caa3b7fb58ade15ca7cf Mon Sep 17 00:00:00 2001 From: jgromes Date: Sat, 23 Nov 2019 15:34:19 +0100 Subject: [PATCH] Added guard to only compile Radio class when using RadioShield --- src/RadioLib.h | 4 ++++ src/TypeDef.h | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/src/RadioLib.h b/src/RadioLib.h index db927d6a..538b9228 100644 --- a/src/RadioLib.h +++ b/src/RadioLib.h @@ -77,6 +77,9 @@ #include "protocols/MQTT/MQTT.h" #endif +// only create Radio class when using RadioShield +#ifdef RADIOLIB_RADIOSHIELD + // RadioShield pin definitions #define RADIOSHIELD_CS_A 10 #define RADIOSHIELD_RX_A 9 @@ -115,5 +118,6 @@ class Radio { }; Radio RadioShield; +#endif #endif diff --git a/src/TypeDef.h b/src/TypeDef.h index 1c782564..c9898a93 100644 --- a/src/TypeDef.h +++ b/src/TypeDef.h @@ -53,6 +53,11 @@ */ //#define RADIOLIB_GODMODE +/* + * Uncomment to enable pre-defined modules when using RadioShield. + */ +//#define RADIOLIB_RADIOSHIELD + /* * The following platforms do not support SoftwareSerial library. */