spkmodem-decode: fix learn_samples increment

oops!!!

another mistake during refactoring. right now it
doesn't increment before being checked, so learning
can go forever in an infinite loop

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-12 23:42:00 +00:00
parent 011c65ddf4
commit 84b0b8a543
+2 -2
View File
@@ -463,13 +463,13 @@ auto_detect_tone(struct decoder_state *st)
if (st->learn_samples >= LEARN_SAMPLES) if (st->learn_samples >= LEARN_SAMPLES)
return; return;
st->learn_samples++;
if (silent_signal(st)) if (silent_signal(st))
return; return;
select_low_tone(st); select_low_tone(st);
st->learn_samples++;
if (st->learn_samples == LEARN_SAMPLES) { if (st->learn_samples == LEARN_SAMPLES) {
st->freq_threshold = st->freq_threshold =
(st->freq_min + st->freq_max) / 2; (st->freq_min + st->freq_max) / 2;