From 5554cc46a72acb56bee55613a39bd1e44095ecba Mon Sep 17 00:00:00 2001 From: Andrew Yong Date: Wed, 8 May 2024 20:15:06 +0800 Subject: [PATCH] Add REGULATORY_ prefix to LORA_REGIONCODE Add REGULATORY_ prefix to LORA_REGIONCODE to prepare for more regulatory configuration options, and update comment block accordingly too. Signed-off-by: Andrew Yong --- src/configuration.h | 6 +++--- src/mesh/RadioInterface.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/configuration.h b/src/configuration.h index 462210cf2..6dcca72dc 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -75,11 +75,11 @@ along with this program. If not, see . #endif // ----------------------------------------------------------------------------- -// Regulatory overrides for producing regional builds +// Regulatory overrides // ----------------------------------------------------------------------------- -// Define if region should override user saved region -// #define LORA_REGIONCODE meshtastic_Config_LoRaConfig_RegionCode_SG_923 +// Override user saved region, for producing region-locked builds +// #define REGULATORY_LORA_REGIONCODE meshtastic_Config_LoRaConfig_RegionCode_SG_923 // ----------------------------------------------------------------------------- // Feature toggles diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index cc6ccca07..7a1fcfb94 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -154,8 +154,8 @@ static uint8_t bytes[MAX_RHPACKETLEN]; void initRegion() { const RegionInfo *r = regions; -#ifdef LORA_REGIONCODE - for (; r->code != meshtastic_Config_LoRaConfig_RegionCode_UNSET && r->code != LORA_REGIONCODE; r++) +#ifdef REGULATORY_LORA_REGIONCODE + for (; r->code != meshtastic_Config_LoRaConfig_RegionCode_UNSET && r->code != REGULATORY_LORA_REGIONCODE; r++) ; LOG_INFO("Wanted region %d, regulatory override to %s\n", config.lora.region, r->name); #else