From a0abcb9f53f805dc7200c81efe2fab14fd58c7e8 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 16 May 2023 13:22:09 +0100 Subject: util/spkmodem_recv: Re-order functions for clarity print_char() is referenced last, so declare it last. Signed-off-by: Leah Rowe --- util/spkmodem_recv/spkmodem-recv.c | 48 +++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/util/spkmodem_recv/spkmodem-recv.c b/util/spkmodem_recv/spkmodem-recv.c index 82b71343..94a0069e 100644 --- a/util/spkmodem_recv/spkmodem-recv.c +++ b/util/spkmodem_recv/spkmodem-recv.c @@ -74,30 +74,6 @@ handle_audio(void) fetch_sample(); } -void -print_char(void) -{ -#if DEBUG - long stdin_pos = 0; - if ((stdin_pos = ftell(stdin)) == -1) - err(errno, NULL); - printf ("%d %d %d @%ld\n", f1, f2, FREQ_DATA_THRESHOLD, - stdin_pos - sizeof(frame)); -#endif - if (f1 < FREQ_DATA_THRESHOLD) - ascii |= (1 << ascii_bit); - ascii_bit--; - if (ascii_bit < 0) { -#if DEBUG - printf("<%c, %x>", ascii, ascii); -#else - printf("%c", ascii); -#endif - ascii_bit = 7; - ascii = 0; - } -} - void fetch_sample(void) { @@ -122,3 +98,27 @@ fetch_sample(void) ringpos %= 2 * SAMPLES_PER_FRAME; lp++; } + +void +print_char(void) +{ +#if DEBUG + long stdin_pos = 0; + if ((stdin_pos = ftell(stdin)) == -1) + err(errno, NULL); + printf ("%d %d %d @%ld\n", f1, f2, FREQ_DATA_THRESHOLD, + stdin_pos - sizeof(frame)); +#endif + if (f1 < FREQ_DATA_THRESHOLD) + ascii |= (1 << ascii_bit); + ascii_bit--; + if (ascii_bit < 0) { +#if DEBUG + printf("<%c, %x>", ascii, ascii); +#else + printf("%c", ascii); +#endif + ascii_bit = 7; + ascii = 0; + } +} -- cgit v1.2.1