diff options
| author | Leah Rowe <leah@libreboot.org> | 2023-05-16 13:22:09 +0100 | 
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2023-05-16 23:11:35 +0100 | 
| commit | a0abcb9f53f805dc7200c81efe2fab14fd58c7e8 (patch) | |
| tree | b8a43be564e0eed2e05682d8b1309f43c92be522 /util | |
| parent | 93cc66425473a3ab8911220d0a6eb9ea27ae3c75 (diff) | |
util/spkmodem_recv: Re-order functions for clarity
print_char() is referenced last, so declare it last.
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util')
| -rw-r--r-- | util/spkmodem_recv/spkmodem-recv.c | 48 | 
1 files 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 @@ -75,30 +75,6 @@ handle_audio(void)  }  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)  {  	amplitude -= abs(frame[ringpos]); @@ -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; +	} +} | 
