mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-08-04 03:06:12 +00:00
fix(repeater): validate profile against chip freq bounds; fix digit-editor padding
isValidRepeaterProfile() hard-coded the 150-960 MHz SX1262 range, which would wrongly reject legal frequencies on any other chip. Take the freq bounds as parameters and pass radio_driver.getFreqBounds() at both call sites (repeaterProfileValid() and the load-time migration), so the chip's own validated range is the single source of truth. DataStore.cpp gains a target.h include for radio_driver (declared extern there). DigitEditor::render() now zero-pads the integer part to int_digits: the cursor addresses place values (100/10/1/0.1…), so a value with fewer integer digits than int_digits would shift every glyph and misplace the highlight. No visual change for the frequency field (always 3 digits). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
52e65b960f
commit
4369a0cc74
@@ -222,9 +222,11 @@ public:
|
||||
// pins power to the ceiling.
|
||||
bool apcActive() const { return _prefs.tx_apc && !_prefs.client_repeat; }
|
||||
|
||||
// True when the optional repeater radio profile is a valid LoRa config.
|
||||
// True when the optional repeater radio profile is a valid LoRa config for
|
||||
// this radio (freq bounds come from the chip's own validated range).
|
||||
bool repeaterProfileValid() const {
|
||||
return isValidRepeaterProfile(_prefs.repeater_freq, _prefs.repeater_bw, _prefs.repeater_sf, _prefs.repeater_cr);
|
||||
float lo, hi; radio_driver.getFreqBounds(lo, hi);
|
||||
return isValidRepeaterProfile(_prefs.repeater_freq, _prefs.repeater_bw, _prefs.repeater_sf, _prefs.repeater_cr, lo, hi);
|
||||
}
|
||||
// Load the radio with the correct params for the current mode: the repeater
|
||||
// profile when relaying with a valid dedicated profile, otherwise the
|
||||
|
||||
Reference in New Issue
Block a user