Skip to content

Commit 5ada7cf

Browse files
committed
reset noise_floor sampling after agc reset
1 parent 551f36f commit 5ada7cf

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/helpers/radiolib/RadioLibWrappers.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ void RadioLibWrapper::resetAGC() {
6363

6464
doResetAGC();
6565
state = STATE_IDLE; // trigger a startReceive()
66+
67+
// Reset noise floor sampling so it reconverges from scratch.
68+
// Without this, a stuck _noise_floor of -120 makes the sampling threshold
69+
// too low (-106) to accept normal samples (~-105), self-reinforcing the
70+
// stuck value even after the receiver has recovered.
71+
_noise_floor = 0;
72+
_num_floor_samples = 0;
73+
_floor_sample_sum = 0;
6674
}
6775

6876
void RadioLibWrapper::loop() {

0 commit comments

Comments
 (0)