diff --git a/src/mesh/FloodingRouter.cpp b/src/mesh/FloodingRouter.cpp index ced9c9043..a494cbd57 100644 --- a/src/mesh/FloodingRouter.cpp +++ b/src/mesh/FloodingRouter.cpp @@ -163,10 +163,8 @@ void FloodingRouter::mergeMyCoverage(CoverageFilter &coverage) float FloodingRouter::calculateForwardProbability(const CoverageFilter &incoming, NodeNum from) { -#ifdef USERPREFS_USE_COVERAGE_FILTER - bool useCoverageFilter = USERPREFS_USE_COVERAGE_FILTER; - if (!useCoverageFilter) - return 1.0f; +#if defined(USERPREFS_USE_COVERAGE_FILTER) && USERPREFS_USE_COVERAGE_FILTER == true + return 1.0f; #endif // If we are a router or repeater, always forward because it's assumed these are in the most advantageous locations // or if we haven't heard from any other nodes within the stale coverage time, fall back to always forward diff --git a/src/mesh/MeshTypes.h b/src/mesh/MeshTypes.h index da1af5ef9..2b63a4f0f 100644 --- a/src/mesh/MeshTypes.h +++ b/src/mesh/MeshTypes.h @@ -36,7 +36,7 @@ enum RxSource { * too long. **/ -#if defined(USERPREFS_USE_COVERAGE_FILTER) && USERPREFS_USE_COVERAGE_FILTER +#if defined(USERPREFS_USE_COVERAGE_FILTER) && USERPREFS_USE_COVERAGE_FILTER == true #define HOP_MAX 15 #else #define HOP_MAX 7 diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 2fdb5f9f9..4b031ca30 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -494,10 +494,8 @@ void NodeDB::installDefaultConfig(bool preserveKey = false) config.lora.modem_preset = meshtastic_Config_LoRaConfig_ModemPreset_LONG_FAST; #endif config.lora.hop_limit = HOP_RELIABLE; -#ifdef USERPREFS_USE_COVERAGE_FILTER - bool useCoverageFilter = USERPREFS_USE_COVERAGE_FILTER; - if (useCoverageFilter) - config.lora.hop_limit = HOP_MAX; +#if defined(USERPREFS_USE_COVERAGE_FILTER) && USERPREFS_USE_COVERAGE_FILTER == true + config.lora.hop_limit = HOP_MAX; #endif #ifdef USERPREFS_CONFIG_LORA_IGNORE_MQTT config.lora.ignore_mqtt = USERPREFS_CONFIG_LORA_IGNORE_MQTT; diff --git a/userPrefs.jsonc b/userPrefs.jsonc index 33cff6abd..4685cd7d6 100644 --- a/userPrefs.jsonc +++ b/userPrefs.jsonc @@ -35,5 +35,5 @@ // "USERPREFS_USE_ADMIN_KEY_1": "{}", // "USERPREFS_USE_ADMIN_KEY_2": "{}", // "USERPREFS_NODEINFO_BROADCAST_CHANNEL_HASH": "8", - "USERPREFS_USE_COVERAGE_FILTER": "true" + "USERPREFS_USE_COVERAGE_FILTER": "false" }