mirror of
git://projects.qi-hardware.com/ben-blinkenlights.git
synced 2024-11-23 22:42:49 +02:00
ubb-patgen/ubb-patgen.c: option -q when dumping frequencies suppressed details
... and avoids pretty-printing.
This commit is contained in:
parent
eedb0f0106
commit
1aedd4b57b
@ -92,18 +92,22 @@ static void print_freq(FILE *file, double f)
|
||||
}
|
||||
|
||||
|
||||
static void show_frequencies(void)
|
||||
static void show_frequencies(int quiet)
|
||||
{
|
||||
const struct mmcclk *clks;
|
||||
int n, i;
|
||||
|
||||
clks = frequencies(&n);
|
||||
for (i = 0; i != n; i++) {
|
||||
if (quiet) {
|
||||
printf("%f\n", clks[i].bus_clk_hz);
|
||||
} else {
|
||||
printf("clkdiv = %u, clkrt = %u, bus_clk = ",
|
||||
clks[i].clkdiv, clks[i].clkrt);
|
||||
print_freq(stdout, clks[i].bus_clk_hz);
|
||||
putchar('\n');
|
||||
}
|
||||
}
|
||||
free((void *) clks);
|
||||
}
|
||||
|
||||
@ -443,13 +447,14 @@ static void usage(const char *name)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"usage: %s\n"
|
||||
" %s -f freq_hz\n"
|
||||
" %s [-f freq_hz] [-q] -c [active_s]\n"
|
||||
" %s [-f freq_hz] [-q] [-C] pattern\n\n"
|
||||
" %s [-q] -f freq_hz\n"
|
||||
" %s [-q] [-f freq_hz] -c [active_s]\n"
|
||||
" %s [-q] [-f freq_hz] [-C] pattern\n\n"
|
||||
" -c output bus clock on CLK without sending a pattern\n"
|
||||
" -C temporarily output bus clock on CLK (for debugging)\n"
|
||||
" -f freq_hz set bus clock to the specified frequency (default: 1 MHz)\n"
|
||||
" -q quiet. Don't report clock differences.\n\n"
|
||||
" -q quiet. Don't pretty-print frequencies; don't report clock\n"
|
||||
" differences.\n\n"
|
||||
" active_s keep running that many seconds after setting the clock\n"
|
||||
" (default: exit immediately but leave the clock on)\n"
|
||||
" pattern send the specified pattern on DAT0 through DAT3\n\n"
|
||||
@ -502,7 +507,7 @@ int main(int argc, char **argv)
|
||||
case 0:
|
||||
if (clk_only)
|
||||
break;
|
||||
if (clkout || quiet)
|
||||
if (clkout)
|
||||
usage(*argv);
|
||||
|
||||
ubb_open(UBB_ALL);
|
||||
@ -514,7 +519,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
printf("%f\n", clk.bus_clk_hz);
|
||||
} else {
|
||||
show_frequencies();
|
||||
show_frequencies(quiet);
|
||||
}
|
||||
return 0;
|
||||
case 1:
|
||||
|
Loading…
Reference in New Issue
Block a user