mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 05:52:36 +02:00
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>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user