diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-13 01:49:07 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-26 06:59:41 +0000 |
| commit | 15079d02bd5ae549237480d1a16470d967522c14 (patch) | |
| tree | 593775dee0e3b27a1a74d044af4a68fe9b7347eb /util/spkmodem_decode/spkmodem-decode.c | |
| parent | 3245333c5376462b789e69352975c46bb91ff6a6 (diff) | |
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>
Diffstat (limited to 'util/spkmodem_decode/spkmodem-decode.c')
| -rw-r--r-- | util/spkmodem_decode/spkmodem-decode.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/util/spkmodem_decode/spkmodem-decode.c b/util/spkmodem_decode/spkmodem-decode.c index 65a0b52b..64a8e106 100644 --- a/util/spkmodem_decode/spkmodem-decode.c +++ b/util/spkmodem_decode/spkmodem-decode.c @@ -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; } |
