From 50db29c3b65b34e56c2836199573efaa6155c1a8 Mon Sep 17 00:00:00 2001 From: Terry Moore Date: Mon, 4 Jun 2018 01:50:32 -0400 Subject: [PATCH] Fix #68: define CFG_region as a numeric constant --- src/lmic/lmic_config_preconditions.h | 31 +++++++++++++++++++--------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/lmic/lmic_config_preconditions.h b/src/lmic/lmic_config_preconditions.h index 35e2011d..4d31cb36 100644 --- a/src/lmic/lmic_config_preconditions.h +++ b/src/lmic/lmic_config_preconditions.h @@ -126,16 +126,27 @@ Revision history: 0) // the selected region. -#define CFG_region ((defined(CFG_eu868) * LMIC_REGION_eu868) + \ - (defined(CFG_us915) * LMIC_REGION_us915) + \ - (defined(CFG_cn783) * LMIC_REGION_cn783) + \ - (defined(CFG_eu433) * LMIC_REGION_eu433) + \ - (defined(CFG_au921) * LMIC_REGION_au921) + \ - (defined(CFG_cn490) * LMIC_REGION_cn490) + \ - (defined(CFG_as923) * LMIC_REGION_as923) + \ - (defined(CFG_kr921) * LMIC_REGION_kr921) + \ - (defined(CFG_in866) * LMIC_REGION_in866) + \ - 0) +#if defined(CFG_eu868) +# define CFG_region LMIC_REGION_eu868 +#elif defined(CFG_us915) +# define CFG_region LMIC_REGION_us915 +#elif defined(CFG_cn783) +# define CFG_region LMIC_REGION_cn783 +#elif defined(CFG_eu433) +# define CFG_region LMIC_REGION_eu433 +#elif defined(CFG_au921) +# define CFG_region LMIC_REGION_au921 +#elif defined(CFG_cn490) +# define CFG_region LMIC_REGION_cn490 +#elif defined(CFG_as923) +# define CFG_region LMIC_REGION_as923 +#elif defined(CFG_kr921) +# define CFG_region LMIC_REGION_kr921 +#elif defined(CFG_in866) +# define CFG_region LMIC_REGION_in866 +#else +# define CFG_region 0 +#endif // finally the mask of` US-like and EU-like regions #define CFG_LMIC_EU_like_MASK ( \