summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-12 21:33:46 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-26 06:49:05 +0000
commit6eff58aa7d593cc6362870cec23d69097c017b8e (patch)
tree62a6c601164835a8178f8001281236114431df24 /util
parent30d5ca51465800335fb402162799f5aaa5953666 (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')
-rw-r--r--util/spkmodem_decode/spkmodem-decode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/spkmodem_decode/spkmodem-decode.c b/util/spkmodem_decode/spkmodem-decode.c
index 442431ab..067520bd 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);