From 9a6d290871a951a420f9eeb77bf22365c6ca4433 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 4 Jun 2023 15:31:23 +0100 Subject: util/spkmodem-recv: another minor code cleanup Signed-off-by: Leah Rowe --- util/spkmodem_recv/spkmodem-recv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'util/spkmodem_recv') diff --git a/util/spkmodem_recv/spkmodem-recv.c b/util/spkmodem_recv/spkmodem-recv.c index b19c49a4..bf522daa 100644 --- a/util/spkmodem_recv/spkmodem-recv.c +++ b/util/spkmodem_recv/spkmodem-recv.c @@ -66,9 +66,8 @@ handle_audio(void) if (lp > (3 * SAMPLES_PER_FRAME)) { ascii_bit = 7; - ascii = 0; - lp = 0; - llp++; + ascii = lp = 0; + ++llp; } if (llp == FLUSH_TIMEOUT) if (fflush(stdout) == EOF) @@ -98,8 +97,9 @@ fetch_sample(void) read_frame(ringpos); pulse[ringpos] = (abs(frame[ringpos]) > THRESHOLD) ? 1 : 0; - if (pulse[ringpos++]) + if (pulse[ringpos]) ++f2; + ++ringpos; ringpos %= 2 * SAMPLES_PER_FRAME; ++lp; } -- cgit v1.2.1