mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-17 08:40:14 +02:00
util/spkmodem-recv: make new pulse calculation clearer
Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -153,6 +153,7 @@ decode_pulse(struct decoder_state *st)
|
|||||||
{
|
{
|
||||||
size_t n;
|
size_t n;
|
||||||
unsigned char old_ring, old_sep;
|
unsigned char old_ring, old_sep;
|
||||||
|
unsigned char new_pulse;
|
||||||
|
|
||||||
old_ring = st->pulse[st->ringpos];
|
old_ring = st->pulse[st->ringpos];
|
||||||
old_sep = st->pulse[st->sep_pos];
|
old_sep = st->pulse[st->sep_pos];
|
||||||
@@ -168,10 +169,9 @@ decode_pulse(struct decoder_state *st)
|
|||||||
err(errno, "stdin read");
|
err(errno, "stdin read");
|
||||||
}
|
}
|
||||||
|
|
||||||
st->pulse[st->ringpos] =
|
new_pulse = abs(st->frame[st->ringpos]) > THRESHOLD;
|
||||||
abs(st->frame[st->ringpos]) > THRESHOLD;
|
st->pulse[st->ringpos] = new_pulse;
|
||||||
|
st->freq_separator += new_pulse;
|
||||||
st->freq_separator += st->pulse[st->ringpos];
|
|
||||||
|
|
||||||
st->ringpos++;
|
st->ringpos++;
|
||||||
if (st->ringpos >= MAX_SAMPLES)
|
if (st->ringpos >= MAX_SAMPLES)
|
||||||
|
|||||||
Reference in New Issue
Block a user