mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-03-29 19:30:00 +00:00
simplify kiss noise floor sampling
This commit is contained in:
@@ -136,21 +136,11 @@ void loop() {
|
||||
int8_t rssi = (int8_t)radio_driver.getLastRSSI();
|
||||
modem->onPacketReceived(snr, rssi, rx_buf, rx_len);
|
||||
}
|
||||
/* Sample noise floor right after drain: we're in STATE_RX so wrapper can collect. */
|
||||
for (int i = 0; i < 16; i++) {
|
||||
radio_driver.loop();
|
||||
}
|
||||
}
|
||||
|
||||
/* Trigger starts a new 64-sample calibration window every 2s. */
|
||||
if ((uint32_t)(millis() - next_noise_floor_calib_ms) >= NOISE_FLOOR_CALIB_INTERVAL_MS) {
|
||||
radio_driver.triggerNoiseFloorCalibrate(0);
|
||||
next_noise_floor_calib_ms = millis();
|
||||
}
|
||||
radio_driver.loop();
|
||||
if (!modem->isActuallyTransmitting()) {
|
||||
for (int i = 0; i < 15; i++) {
|
||||
radio_driver.loop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user