mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-13 06:49:52 +02:00
spkmodem-decode: ignore invalid frames when setting bits
bits are currently assembled even on invalid frames. this patch fixes that - the bug is also in the GNU version. this reduces the chance of noise/calibration from creating corrupt character output during operation. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -410,10 +410,15 @@ set_ascii_bit(struct decoder_state *st)
|
||||
{
|
||||
if (st->debug)
|
||||
print_stats(st);
|
||||
|
||||
if (!is_valid_signal(st))
|
||||
return st->ascii_bit;
|
||||
|
||||
if (st->freq_data < st->freq_threshold)
|
||||
st->ascii |= (1 << st->ascii_bit);
|
||||
|
||||
st->ascii_bit--;
|
||||
|
||||
return st->ascii_bit;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user