From 3722c1e67a2193d4e74106060183f80a92bd66fe Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 16 May 2023 08:13:46 +0100 Subject: util/spkmodem_recv: simplified pulse check Signed-off-by: Leah Rowe --- util/spkmodem_recv/spkmodem-recv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/util/spkmodem_recv/spkmodem-recv.c b/util/spkmodem_recv/spkmodem-recv.c index ecee6fbb..5efa25a7 100644 --- a/util/spkmodem_recv/spkmodem-recv.c +++ b/util/spkmodem_recv/spkmodem-recv.c @@ -36,8 +36,7 @@ read_sample (void) fread (trame + ringpos, 1, sizeof (trame[0]), stdin); amplitude += abs (trame[ringpos]); - if (pos ? (trame[ringpos] < -THRESHOLD) - : (trame[ringpos] > +THRESHOLD)) { + if (abs(trame[ringpos]) > THRESHOLD) { /* rising/falling edge(pulse) */ pulse[ringpos] = 1; pos = !pos; f2++; -- cgit v1.2.1