diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-12 21:33:46 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-12 21:33:46 +0000 |
| commit | c8d078f9c7a82d3f0b5406c5ac96fbe76de6d740 (patch) | |
| tree | 5ff6ab6dacb29b09591d1b571f4599f4636ea724 /util/spkmodem_decode | |
| parent | 10e09d6402b43d4d3d61fb10895d169c888b1af1 (diff) | |
util/spkmodem-recv: reset char precisely on timeout
instead of when it goes above, do it precisely on the
timeout. otherwise, if by sheer chance the signal
pauses and we reset the byte - sure, ok, but it's a
bit tight and we run the risk of advancing another
frame, depending on the timing.
this is a minor edge case, probably rarely ever
triggered in practise.
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/spkmodem_decode')
| -rw-r--r-- | util/spkmodem_decode/spkmodem-decode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/util/spkmodem_decode/spkmodem-decode.c b/util/spkmodem_decode/spkmodem-decode.c index 820fa61e..9ba060d7 100644 --- a/util/spkmodem_decode/spkmodem-decode.c +++ b/util/spkmodem_decode/spkmodem-decode.c @@ -259,7 +259,7 @@ handle_audio(struct decoder_state *st) * If the modem signal disappears for several frames, * discard the partially assembled character. */ - if (st->sample_count > (3 * SAMPLES_PER_FRAME)) + if (st->sample_count >= (3 * SAMPLES_PER_FRAME)) reset_char(st); if (!valid_signal(st)) { decode_pulse(st); |
