mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 14:02:52 +02:00
util/spkmodem-recv: clearer pulse decoding
i turned this into abs() call earlier, but this isn't obviously readable by some people. make it absolutely clear what this does. also reduces use of syscalls. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -174,7 +174,12 @@ decode_pulse(struct decoder_state *st)
|
||||
|
||||
st->frame[st->ringpos] = read_sample(st);
|
||||
|
||||
new_pulse = abs(st->frame[st->ringpos]) > THRESHOLD;
|
||||
if (st->frame[st->ringpos] > THRESHOLD ||
|
||||
st->frame[st->ringpos] < -THRESHOLD)
|
||||
new_pulse = 1;
|
||||
else
|
||||
new_pulse = 0;
|
||||
|
||||
st->pulse[st->ringpos] = new_pulse;
|
||||
st->freq_separator += new_pulse;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user