Share constrained STM32 code while preserving firmware features
Omit unbound forwarding-region callbacks only for exclusive Companion source roles. Reuse the compact neighbor sorter in repeaters for every RPC order and the CLI list, removing duplicate sort implementations while preserving storage and size gates.
This commit is contained in:
1 parent
2b55ff6a62
commit
c650278fa7
7 files changed
+216
-28
No files matched your search
@@ -92,7 +92,7 @@ bool secondaryOverlaps(uint32_t primary_hz, float secondary_mhz, uint32_t cleara
|
||||
return (primary_hz > secondary_hz ? primary_hz - secondary_hz : secondary_hz - primary_hz)
|
||||
<= clearance_hz;
|
||||
}
|
||||
#if !defined(COMPANION_RADIO_FULL)
|
||||
#if !defined(COMPANION_RADIO_FULL) && !MESH_ROLE_COMPANION
|
||||
bool isMediaMeshProfile(const RadioProfileConfig& config) {
|
||||
return config.mode != RadioProfileMode::Off
|
||||
&& config.params.freq >= 911.1495f && config.params.freq <= 911.1505f
|
||||
@@ -102,7 +102,7 @@ bool isMediaMeshProfile(const RadioProfileConfig& config) {
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined(COMPANION_RADIO_FULL)
|
||||
#if !defined(COMPANION_RADIO_FULL) && !MESH_ROLE_COMPANION
|
||||
void RadioProfileCLI::setMediaMeshScopeHandler(MediaMeshScopeHandler handler, void* context) {
|
||||
media_scope_handler_ = handler;
|
||||
media_scope_context_ = context;
|
||||
|
||||
@@ -61,7 +61,7 @@ class RadioProfileCLI {
|
||||
// readable backup. Read/I/O failures and an intact backup remain read-only.
|
||||
bool recoverable_corrupt_store_ = false;
|
||||
bool publish_pending_ = false;
|
||||
#if !defined(COMPANION_RADIO_FULL)
|
||||
#if !defined(COMPANION_RADIO_FULL) && !MESH_ROLE_COMPANION
|
||||
MediaMeshScopeHandler media_scope_handler_ = nullptr;
|
||||
void* media_scope_context_ = nullptr;
|
||||
uint32_t media_scope_retry_ms_ = 0;
|
||||
@@ -71,7 +71,7 @@ class RadioProfileCLI {
|
||||
void retryMediaMeshScope();
|
||||
bool mediaMeshScopePending() const { return media_scope_pending_; }
|
||||
#else
|
||||
// Full Companions have no forwarding RegionMap. Do not retain unreachable
|
||||
// Companions have no forwarding RegionMap. Do not retain unreachable
|
||||
// infrastructure callbacks, state or failure text in their tight images.
|
||||
bool mediaMeshScopeReady(const RadioProfileConfig&) const { return true; }
|
||||
void updateMediaMeshScope() {}
|
||||
@@ -141,7 +141,7 @@ class RadioProfileCLI {
|
||||
#endif
|
||||
void begin(FILESYSTEM* fs, Radio* radio, RTCClock* rtc, bool infrastructure_replies = false);
|
||||
// Bind only after RegionMap::load(), so boot reconciliation is not discarded.
|
||||
#if !defined(COMPANION_RADIO_FULL)
|
||||
#if !defined(COMPANION_RADIO_FULL) && !MESH_ROLE_COMPANION
|
||||
void setMediaMeshScopeHandler(MediaMeshScopeHandler handler, void* context);
|
||||
#else
|
||||
void setMediaMeshScopeHandler(MediaMeshScopeHandler, void*) {}
|
||||
|
||||
Reference in new issue
Block a user