util/spkmodem-decode: don't run decode in col_sep_tone

otherwise, it runs twice

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-12 23:19:32 +00:00
parent 7e29d53667
commit 4dc39990e1
+3 -9
View File
@@ -307,6 +307,7 @@ handle_audio(struct decoder_state *st)
reset_char(st); reset_char(st);
collect_separator_tone(st); collect_separator_tone(st);
decode_pulse(st);
if (set_ascii_bit(st) < 0) if (set_ascii_bit(st) < 0)
print_char(st); print_char(st);
@@ -328,30 +329,23 @@ collect_separator_tone(struct decoder_state *st)
if (valid_signal(st)) if (valid_signal(st))
return; return;
if (st->sep_samples >= 50 && st->freq_separator <= 0) { if (st->sep_samples >= 50 && st->freq_separator <= 0)
decode_pulse(st);
return; return;
}
st->sep_sum += st->freq_separator; st->sep_sum += st->freq_separator;
st->sep_samples++; st->sep_samples++;
if (st->sep_samples != 50) { if (st->sep_samples != 50)
decode_pulse(st);
return; return;
}
avg = st->sep_sum / st->sep_samples; avg = st->sep_sum / st->sep_samples;
/* plus or minus pulse window */
st->sep_min = avg - SEP_TOLERANCE_PULSES; st->sep_min = avg - SEP_TOLERANCE_PULSES;
st->sep_max = avg + SEP_TOLERANCE_PULSES; st->sep_max = avg + SEP_TOLERANCE_PULSES;
if (st->debug) if (st->debug)
printf("separator calibrated: %dHz\n", printf("separator calibrated: %dHz\n",
avg * FRAME_RATE); avg * FRAME_RATE);
decode_pulse(st);
} }
/* /*