mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-22 05:00:08 +02:00
util/spkmodem-recv: print stats in other function
Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -30,6 +30,7 @@ void fetch_sample(void);
|
|||||||
void read_frame(int ringpos);
|
void read_frame(int ringpos);
|
||||||
int set_ascii_bit(void);
|
int set_ascii_bit(void);
|
||||||
void print_char(void);
|
void print_char(void);
|
||||||
|
void print_stats(void);
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
@@ -101,13 +102,8 @@ read_frame(int ringpos)
|
|||||||
int
|
int
|
||||||
set_ascii_bit(void)
|
set_ascii_bit(void)
|
||||||
{
|
{
|
||||||
if (debug) {
|
if (debug)
|
||||||
long stdin_pos = 0;
|
print_stats();
|
||||||
if ((stdin_pos = ftell(stdin)) == -1)
|
|
||||||
err(ERR(), NULL);
|
|
||||||
printf ("%d %d %d @%ld\n", freq_data, freq_separator,
|
|
||||||
FREQ_DATA_THRESHOLD, stdin_pos - sizeof(frame));
|
|
||||||
}
|
|
||||||
if (freq_data < FREQ_DATA_THRESHOLD)
|
if (freq_data < FREQ_DATA_THRESHOLD)
|
||||||
ascii |= (1 << ascii_bit);
|
ascii |= (1 << ascii_bit);
|
||||||
return ascii_bit;
|
return ascii_bit;
|
||||||
@@ -123,3 +119,13 @@ print_char(void)
|
|||||||
ascii_bit = 7;
|
ascii_bit = 7;
|
||||||
ascii = 0;
|
ascii = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
print_stats(void)
|
||||||
|
{
|
||||||
|
long stdin_pos = 0;
|
||||||
|
if ((stdin_pos = ftell(stdin)) == -1)
|
||||||
|
err(ERR(), NULL);
|
||||||
|
printf ("%d %d %d @%ld\n", freq_data, freq_separator,
|
||||||
|
FREQ_DATA_THRESHOLD, stdin_pos - sizeof(frame));
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user