Move G3 repeater policy tables and MQTT WebSocket buffers to PSRAM

This commit is contained in:
mikecarper committed 2026-10-27 13:14:28 -07:00
1 parent a6d472ff9d
commit 74c03cb30f
15 files changed
+1856 -7

No files matched your search

+5
View File
@@ -3707,6 +3707,11 @@ MyMesh::MyMesh(mesh::MainBoard &board, mesh::Radio &radio, mesh::MillisecondCloc
: mesh::Mesh(radio, ms, rng, rtc, *createObserverPacketManager(32), tables),
region_map(key_store), temp_map(key_store),
_cli(board, rtc, sensors, region_map, acl, &_prefs, this),
#if MESH_REPEATER_PSRAM_TABLES
flood_channel_scopes(flood_channel_storage.require("channel scope tables").scopes),
flood_channel_direct_scopes(flood_channel_storage.require("channel scope tables").direct),
flood_channel_scope_requirements(flood_channel_storage.require("channel scope tables").requirements),
#endif
telemetry(MAX_PACKET_PAYLOAD - 4),
discover_limiter(4, 120), // max 4 every 2 minutes
anon_limiter(4, 180) // max 4 every 3 minutes
+24
View File
@@ -9,6 +9,7 @@
#include <helpers/FloodRuleExtensions.h>
#include <helpers/GuestLoginSettings.h>
#include <helpers/LoginHistory.h>
#include <helpers/RepeaterPsramStorage.h>
#if defined(ENABLE_OTA)
#include <helpers/ota/OtaContext.h>
#endif
@@ -558,11 +559,34 @@ class MyMesh : public mesh::Mesh, public CommonCLICallbacks
uint8_t flood_packet_filter_blacklist_count;
uint8_t flood_packet_filter_blacklist[FLOOD_PACKET_FILTER_BLACKLIST_MAX]
[FLOOD_PACKET_FILTER_PATH_ID_SIZE];
#if MESH_REPEATER_PSRAM_TABLES
// Keep real array references: persistence, resets and rollback use sizeof
// these complete tables, and routing retains addresses into them.
struct FloodChannelStorage {
FloodChannelScopeEntry scopes[FLOOD_CHANNEL_SCOPE_SLOTS];
char direct[FLOOD_CHANNEL_DIRECT_SCOPE_SLOTS][FLOOD_PACKET_FILTER_SCOPE_NAME_LEN];
FloodChannelScopeRequireEntry requirements[FLOOD_CHANNEL_SCOPE_REQUIRE_SLOTS];
};
static_assert(sizeof(FloodChannelScopeEntry) == 36
&& sizeof(FloodChannelScopeRequireEntry) == 34
&& sizeof(FloodChannelStorage)
<= FLOOD_CHANNEL_SCOPE_SLOTS * 36U
+ FLOOD_CHANNEL_DIRECT_SCOPE_SLOTS * 32U
+ FLOOD_CHANNEL_SCOPE_REQUIRE_SLOTS * 34U + 2U,
"Update the repeater PSRAM fallback budget in check_firmware_ram.py");
mesh::RepeaterPsramStorage<FloodChannelStorage> flood_channel_storage;
FloodChannelScopeEntry (&flood_channel_scopes)[FLOOD_CHANNEL_SCOPE_SLOTS];
char (&flood_channel_direct_scopes)[FLOOD_CHANNEL_DIRECT_SCOPE_SLOTS]
[FLOOD_PACKET_FILTER_SCOPE_NAME_LEN];
FloodChannelScopeRequireEntry
(&flood_channel_scope_requirements)[FLOOD_CHANNEL_SCOPE_REQUIRE_SLOTS];
#else
FloodChannelScopeEntry flood_channel_scopes[FLOOD_CHANNEL_SCOPE_SLOTS];
char flood_channel_direct_scopes[FLOOD_CHANNEL_DIRECT_SCOPE_SLOTS]
[FLOOD_PACKET_FILTER_SCOPE_NAME_LEN];
FloodChannelScopeRequireEntry
flood_channel_scope_requirements[FLOOD_CHANNEL_SCOPE_REQUIRE_SLOTS];
#endif
#if MESH_ENABLE_FLOOD_GROUP_MODERATION
FloodGroupModerationEntry flood_group_moderation[FLOOD_GROUP_MODERATION_SLOTS];
#endif