diff options
author | Leah Rowe <leah@libreboot.org> | 2023-05-16 08:13:46 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2023-05-16 23:11:35 +0100 |
commit | 3722c1e67a2193d4e74106060183f80a92bd66fe (patch) | |
tree | db256f0b676239b26314fb74b1bce8858cac0311 | |
parent | 88683b767b0da6c3f311d34991e0388a5c1d5299 (diff) |
util/spkmodem_recv: simplified pulse check
Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r-- | util/spkmodem_recv/spkmodem-recv.c | 3 |
1 files changed, 1 insertions, 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++; |