From 3b6eefa8bbfcb2ae02e4e311b190cc2dfef9a05b Mon Sep 17 00:00:00 2001 From: Jacob Powers <5566081+powersjcb@users.noreply.github.com> Date: Thu, 31 Jul 2025 20:45:34 -0600 Subject: [PATCH] feat: event mode - limit smart position updates to at most every 5m (#7505) * feat: event mode - limit smart position updates to at most every 5m * fix: convert 600 to 600000ms for 5min threshold * fix: correct 5min threshold to 300000ms --------- Co-authored-by: Ben Meadors --- src/modules/PositionModule.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/modules/PositionModule.h b/src/modules/PositionModule.h index b9fd527c9..4a2415058 100644 --- a/src/modules/PositionModule.h +++ b/src/modules/PositionModule.h @@ -65,8 +65,15 @@ class PositionModule : public ProtobufModule, private concu bool hasGPS(); uint32_t lastSentReply = 0; // Last time we sent a position reply (used for reply throttling only) +#if USERPREFS_EVENT_MODE + // In event mode we want to prevent excessive position broadcasts + // we set the minimum interval to 5m + const uint32_t minimumTimeThreshold = + max(300000, Default::getConfiguredOrDefaultMs(config.position.broadcast_smart_minimum_interval_secs, 30)); +#else const uint32_t minimumTimeThreshold = Default::getConfiguredOrDefaultMs(config.position.broadcast_smart_minimum_interval_secs, 30); +#endif }; struct SmartPosition {