mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-20 14:18:19 +02:00
util/spkmodem-recv: simplify pulse check
Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -98,16 +98,11 @@ fetch_sample(void)
|
|||||||
!= sizeof(frame[0]))
|
!= sizeof(frame[0]))
|
||||||
err(errno = ECANCELED, "Could not read frame.");
|
err(errno = ECANCELED, "Could not read frame.");
|
||||||
|
|
||||||
if (abs(frame[ringpos]) > THRESHOLD) { /* rising/falling edge(pulse) */
|
pulse[ringpos] = (abs(frame[ringpos]) > THRESHOLD) ? 1 : 0;
|
||||||
pulse[ringpos] = 1;
|
if (pulse[ringpos++])
|
||||||
f2++;
|
++f2;
|
||||||
} else {
|
|
||||||
pulse[ringpos] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ringpos++;
|
|
||||||
ringpos %= 2 * SAMPLES_PER_FRAME;
|
ringpos %= 2 * SAMPLES_PER_FRAME;
|
||||||
lp++;
|
++lp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
Reference in New Issue
Block a user