From 807dc327d6d57d53c5a7ac05e698fc12769b3f09 Mon Sep 17 00:00:00 2001 From: medentem Date: Tue, 7 Jan 2025 13:33:00 -0600 Subject: [PATCH] fixing macros --- src/mesh/FloodingRouter.cpp | 3 ++- src/mesh/MeshTypes.h | 3 ++- src/mesh/NodeDB.cpp | 2 +- userPrefs.jsonc | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/mesh/FloodingRouter.cpp b/src/mesh/FloodingRouter.cpp index a494cbd57..85b620efe 100644 --- a/src/mesh/FloodingRouter.cpp +++ b/src/mesh/FloodingRouter.cpp @@ -163,7 +163,8 @@ void FloodingRouter::mergeMyCoverage(CoverageFilter &coverage) float FloodingRouter::calculateForwardProbability(const CoverageFilter &incoming, NodeNum from) { -#if defined(USERPREFS_USE_COVERAGE_FILTER) && USERPREFS_USE_COVERAGE_FILTER == true +#ifndef USERPREFS_USE_COVERAGE_FILTER + LOG_DEBUG("Coverage filter is NOT enabled."); return 1.0f; #endif // If we are a router or repeater, always forward because it's assumed these are in the most advantageous locations diff --git a/src/mesh/MeshTypes.h b/src/mesh/MeshTypes.h index 2b63a4f0f..136499058 100644 --- a/src/mesh/MeshTypes.h +++ b/src/mesh/MeshTypes.h @@ -36,12 +36,13 @@ enum RxSource { * too long. **/ -#if defined(USERPREFS_USE_COVERAGE_FILTER) && USERPREFS_USE_COVERAGE_FILTER == true +#ifdef USERPREFS_USE_COVERAGE_FILTER #define HOP_MAX 15 #else #define HOP_MAX 7 #endif + /// We normally just use max 3 hops for sending reliable messages #define HOP_RELIABLE 3 diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 4b031ca30..42f170fb5 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -494,7 +494,7 @@ void NodeDB::installDefaultConfig(bool preserveKey = false) config.lora.modem_preset = meshtastic_Config_LoRaConfig_ModemPreset_LONG_FAST; #endif config.lora.hop_limit = HOP_RELIABLE; -#if defined(USERPREFS_USE_COVERAGE_FILTER) && USERPREFS_USE_COVERAGE_FILTER == true +#ifdef USERPREFS_USE_COVERAGE_FILTER config.lora.hop_limit = HOP_MAX; #endif #ifdef USERPREFS_CONFIG_LORA_IGNORE_MQTT diff --git a/userPrefs.jsonc b/userPrefs.jsonc index 4685cd7d6..d1030d091 100644 --- a/userPrefs.jsonc +++ b/userPrefs.jsonc @@ -30,10 +30,10 @@ // "USERPREFS_LORACONFIG_CHANNEL_NUM": "31", // "USERPREFS_LORACONFIG_MODEM_PRESET": "meshtastic_Config_LoRaConfig_ModemPreset_SHORT_FAST", // "USERPREFS_SPLASH_TITLE": "DEFCONtastic", - "USERPREFS_TZ_STRING": "tzplaceholder ", // "USERPREFS_USE_ADMIN_KEY_0": "{ 0xcd, 0xc0, 0xb4, 0x3c, 0x53, 0x24, 0xdf, 0x13, 0xca, 0x5a, 0xa6, 0x0c, 0x0d, 0xec, 0x85, 0x5a, 0x4c, 0xf6, 0x1a, 0x96, 0x04, 0x1a, 0x3e, 0xfc, 0xbb, 0x8e, 0x33, 0x71, 0xe5, 0xfc, 0xff, 0x3c }", // "USERPREFS_USE_ADMIN_KEY_1": "{}", // "USERPREFS_USE_ADMIN_KEY_2": "{}", // "USERPREFS_NODEINFO_BROADCAST_CHANNEL_HASH": "8", - "USERPREFS_USE_COVERAGE_FILTER": "false" + // "USERPREFS_USE_COVERAGE_FILTER": "", + "USERPREFS_TZ_STRING": "tzplaceholder " }