refactor repeater prefs changes

This commit is contained in:
liquidraver
2026-04-28 13:49:08 +02:00
parent bf9ad0ef40
commit e18d017b2c
6 changed files with 29 additions and 5 deletions
+8 -1
View File
@@ -576,7 +576,7 @@ uint32_t RepeaterMesh::getDirectRetransmitDelay(const mesh::Packet* packet) {
/* Jitter around Arduino direct factor 0.3 using a per-packet factor
* in the range [0.25, 0.40]. */
uint32_t factor_milli = (uint32_t)getRNG()->nextInt(250, 401);
uint32_t max_jitter = (5 * airtime * factor_milli) / 1000;
uint32_t max_jitter = (airtime * factor_milli) / 1000;
/* Floor: give downstream nodes time to finish RX processing
* and return to RX mode before we TX (~20ms settle + jitter). */
return 20 + getRNG()->nextInt(0, max_jitter + 1);
@@ -1028,6 +1028,13 @@ void RepeaterMesh::applyTempRadioParams(float freq, float bw, uint8_t sf, uint8_
revert_radio_at = futureMillis(2000 + timeout_mins * 60 * 1000);
}
void RepeaterMesh::freezeRadioParams(float freq, float bw, uint8_t sf, uint8_t cr) {
auto& radio = getRadioDriver(_radio);
if (!radio.hasRadioOverride()) {
radio.setRadioOverride(freq, bw, sf, cr);
}
}
bool RepeaterMesh::formatFileSystem() {
if (_store) {
return _store->formatFileSystem();