fixing ifdefs

This commit is contained in:
medentem 2025-01-07 12:55:40 -06:00
parent aac890d537
commit bcce6c83d9
4 changed files with 6 additions and 10 deletions

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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"
}