feat(companion): repeater mode, radio presets, and manual RF tuning in Settings

Settings > Radio gains:
- Repeater toggle — turns on flood forwarding (client_repeat) on the current
  operating frequency, with loop-detection and an 8-hop advert cap ported
  from simple_repeater's allowPacketForward.
- Packet pool bumped 16->32: forwarding's queued retransmits were starving
  Dispatcher::checkRecv()'s allocNew(), silently dropping incoming DMs and
  channel messages while repeating.
- Preset picker (16 community-suggested region presets) plus manual
  Freq/SF/BW/CR fields for fine-tuning. Freq bounds come from the radio
  driver's own RadioLib-validated range (SX1262: 150-960MHz) instead of a
  guessed sanity bound.
- Save current radio settings as a named user preset (4 persisted slots),
  alongside the built-in list.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-06-18 17:23:30 +02:00
co-authored by Claude Sonnet 4.6
parent 1bf90ed2fb
commit 056a786fc8
11 changed files with 319 additions and 5 deletions
+13 -1
View File
@@ -140,11 +140,23 @@ struct NodePrefs { // persisted to file
// shows ✗. 0 = no auto-resend (single attempt). Default 2.
uint8_t dm_resend_count;
// User-saved radio presets (Settings > Radio > Preset > "Save current...").
// name[0] == '\0' marks an empty slot.
struct UserRadioPreset {
char name[16];
float freq;
float bw;
uint8_t sf;
uint8_t cr;
};
static const uint8_t USER_RADIO_PRESET_MAX = 4;
UserRadioPreset user_radio_presets[USER_RADIO_PRESET_MAX];
// Tail sentinel written at the end of /new_prefs. Bump the low byte when
// adding/removing/reordering fields in DataStore::savePrefs/loadPrefsInt so
// older saves are detected on load and skipped (zero-init defaults kept).
// High 24 bits identify the file format; low byte is the schema revision.
static const uint32_t SCHEMA_SENTINEL = 0xC0DE000C;
static const uint32_t SCHEMA_SENTINEL = 0xC0DE000D;
// Bit-index for each home page. Used by page_order (entries store bit+1) and
// by home_pages_mask. Single source of truth — both HomeScreen::pageBit/bitToPage