mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
* dynamic noise floor sampling
This commit is contained in:
parent
f2243b78ae
commit
0e35ae5ec6
4 changed files with 33 additions and 5 deletions
|
|
@ -10,6 +10,10 @@ namespace mesh {
|
|||
|
||||
#define MAX_RX_DELAY_MILLIS 32000 // 32 seconds
|
||||
|
||||
#ifndef NOISE_FLOOR_CALIB_INTERVAL
|
||||
#define NOISE_FLOOR_CALIB_INTERVAL 2000 // 2 seconds
|
||||
#endif
|
||||
|
||||
void Dispatcher::begin() {
|
||||
n_sent_flood = n_sent_direct = 0;
|
||||
n_recv_flood = n_recv_direct = 0;
|
||||
|
|
@ -36,6 +40,10 @@ uint32_t Dispatcher::getCADFailMaxDuration() const {
|
|||
}
|
||||
|
||||
void Dispatcher::loop() {
|
||||
if (millisHasNowPassed(next_floor_calib_time)) {
|
||||
_radio->triggerNoiseFloorCalibrate();
|
||||
next_floor_calib_time = futureMillis(NOISE_FLOOR_CALIB_INTERVAL);
|
||||
}
|
||||
_radio->loop();
|
||||
|
||||
// check for radio 'stuck' in mode other than Rx
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue