mirror of
git://projects.qi-hardware.com/ben-blinkenlights.git
synced 2024-11-23 22:57:11 +02:00
ubb-patgen/ubb-patgen.c: remove pattern frequency and use -f for bus clock
Let's leave fancy oversampling calculations to the user.
This commit is contained in:
parent
6e6767175f
commit
1111156a97
@ -443,12 +443,11 @@ static void usage(const char *name)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"usage: %s\n"
|
||||
" %s [-b freq_hz] [-f freq_hz] -c [-q] [active_s]\n"
|
||||
" %s [-b freq_hz] [-f freq_hz] [-C] [-q] pattern\n\n"
|
||||
" -b freq_hz set bus clock to the specified frequency (default: 1 MHz)\n"
|
||||
" %s [-f freq_hz] -c [-q] [active_s]\n"
|
||||
" %s [-f freq_hz] [-C] [-q] 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 pattern rate (default: same as bus clock)\n"
|
||||
" -f freq_hz set bus clock to the specified frequency (default: 1 MHz)\n"
|
||||
" -q quiet. Don't report clock differences.\n\n"
|
||||
" active_s keep running that many seconds after setting the clock\n"
|
||||
" (default: exit immediately but leave the clock on)\n"
|
||||
@ -468,7 +467,6 @@ int main(int argc, char **argv)
|
||||
{
|
||||
struct mmcclk clk;
|
||||
int bus_hz = 0, clk_only = 0, clkout = 0, bus_rel = 0;
|
||||
int pattern_hz = 0, pattern_rel = 0;
|
||||
const char *pattern = NULL;
|
||||
int quiet = 0;
|
||||
double active_s = 0;
|
||||
@ -477,14 +475,10 @@ int main(int argc, char **argv)
|
||||
char *end;
|
||||
int c;
|
||||
|
||||
while ((c = getopt(argc, argv, "b:cCq")) != EOF)
|
||||
while ((c = getopt(argc, argv, "cCf:q")) != EOF)
|
||||
switch (c) {
|
||||
case 'b':
|
||||
if (!frequency(optarg, &bus_hz, &bus_rel))
|
||||
usage(*argv);
|
||||
break;
|
||||
case 'f':
|
||||
if (!frequency(optarg, &pattern_hz, &pattern_rel))
|
||||
if (!frequency(optarg, &bus_hz, &bus_rel))
|
||||
usage(*argv);
|
||||
break;
|
||||
case 'c':
|
||||
@ -504,7 +498,7 @@ int main(int argc, char **argv)
|
||||
case 0:
|
||||
if (clk_only)
|
||||
break;
|
||||
if (bus_hz || pattern_hz || clkout || quiet)
|
||||
if (bus_hz || clkout || quiet)
|
||||
usage(*argv);
|
||||
ubb_open(UBB_ALL);
|
||||
show_frequencies();
|
||||
|
Loading…
Reference in New Issue
Block a user