diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-12 04:59:42 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-12 04:59:42 +0000 |
| commit | 2c3d0b5a3e681bfa9f978fc9f343219f01cc023e (patch) | |
| tree | 5387076c76d65b0d945a3c4ba25db068ef30ee3b | |
| parent | 62a496ec9e02553ce3c662e1d019e4e7655d1fa1 (diff) | |
util/spkmodem-recv: make new pulse calculation clearer
Signed-off-by: Leah Rowe <leah@libreboot.org>
| -rw-r--r-- | util/spkmodem_recv/spkmodem-recv.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/util/spkmodem_recv/spkmodem-recv.c b/util/spkmodem_recv/spkmodem-recv.c index bbf73384..7bfdaff3 100644 --- a/util/spkmodem_recv/spkmodem-recv.c +++ b/util/spkmodem_recv/spkmodem-recv.c @@ -153,6 +153,7 @@ decode_pulse(struct decoder_state *st) { size_t n; unsigned char old_ring, old_sep; + unsigned char new_pulse; old_ring = st->pulse[st->ringpos]; old_sep = st->pulse[st->sep_pos]; @@ -168,10 +169,9 @@ decode_pulse(struct decoder_state *st) err(errno, "stdin read"); } - st->pulse[st->ringpos] = - abs(st->frame[st->ringpos]) > THRESHOLD; - - st->freq_separator += st->pulse[st->ringpos]; + new_pulse = abs(st->frame[st->ringpos]) > THRESHOLD; + st->pulse[st->ringpos] = new_pulse; + st->freq_separator += new_pulse; st->ringpos++; if (st->ringpos >= MAX_SAMPLES) |
