From 9b7249428b5f28af57719758b1271b3b3e989467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vikstr=C3=B6m?= Date: Tue, 3 Jun 2025 18:41:13 +0200 Subject: [PATCH 1/2] Add option for external radio --- src/lmic/config.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/lmic/config.h b/src/lmic/config.h index 028ec8ae..09e32bb5 100644 --- a/src/lmic/config.h +++ b/src/lmic/config.h @@ -48,9 +48,19 @@ // This is the SX1276/SX1277/SX1278/SX1279 radio, which is also used on // the HopeRF RFM95 boards. //#define CFG_sx1276_radio 1 +// If on the other hand the radio drivers are supplied externally, +// then you can use external_radio, and the library will not +// include any radio drivers. This is useful if you want to use a +// different radio driver, or if you want to use the library with +// a radio that is not supported by the library. +//#define CFG_external_radio 1 // ensure that a radio is defined. -#if !(defined(CFG_sx1272_radio) || defined(CFG_sx1276_radio) || defined(CFG_sx1261_radio) || defined(CFG_sx1262_radio)) +#if defined(CFG_external_radio) +#if defined(CFG_sx1272_radio) || defined(CFG_sx1276_radio) || defined(CFG_sx1261_radio) || defined(CFG_sx1262_radio) +# error "You cannot define CFG_external_radio and a target radio at the same time" +#endif +#elif !(defined(CFG_sx1272_radio) || defined(CFG_sx1276_radio) || defined(CFG_sx1261_radio) || defined(CFG_sx1262_radio)) # warning Target radio not defined, assuming CFG_sx1276_radio #define CFG_sx1276_radio 1 #elif defined(CFG_sx1272_radio) && (defined(CFG_sx1276_radio) || defined(CFG_sx1261_radio) || defined(CFG_sx1262_radio)) From 4d94bdf549ef64dc819fae5ccfcd25c074a0d75f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vikstr=C3=B6m?= Date: Tue, 3 Jun 2025 18:48:55 +0200 Subject: [PATCH 2/2] Add message that external radio is selected --- src/lmic/config.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lmic/config.h b/src/lmic/config.h index 09e32bb5..fcfd8be1 100644 --- a/src/lmic/config.h +++ b/src/lmic/config.h @@ -57,6 +57,7 @@ // ensure that a radio is defined. #if defined(CFG_external_radio) +# warning "Compiling with External radion definitions, make sure to supply the necessary function definitions" #if defined(CFG_sx1272_radio) || defined(CFG_sx1276_radio) || defined(CFG_sx1261_radio) || defined(CFG_sx1262_radio) # error "You cannot define CFG_external_radio and a target radio at the same time" #endif