1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2024-11-23 18:15:55 +02:00

ubb-patgen/ubb-patgen.c: new option -I inter_s to select "unsafe" frequencies

This commit is contained in:
Werner Almesberger 2013-01-28 21:20:25 -03:00
parent 04b235cedf
commit 128590bee0
2 changed files with 12 additions and 8 deletions

View File

@ -63,10 +63,6 @@ bus clk = 100.962 kHz (+0.96%)
This warning can be suppressed with the option -q.
The option -F works like -f but also allows frequencies that may
exceed the hardware's capabilities. As a consequence, the MMC
controller may hang.
The frequency can also be specified as the cycle time with the
option -i:
@ -75,6 +71,10 @@ option -i:
The meaning of an appended + or - changes here, e.g., 10us+
selects a slower clock (producing an interval of at least 10 us).
The options -F and -I work like -f and -i but also allows
frequencies that may exceed the hardware's capabilities. As a
consequence, the MMC controller may hang.
Clock output
------------

View File

@ -691,9 +691,9 @@ static void usage(const char *name)
{
fprintf(stderr,
"usage: %s\n"
" %s [-q] (-f|-F) freq_hz|-i interval_s\n"
" %s [-q] [(-f|-F) freq_hz|-i interval_s] -c [active_s]\n"
" %s [-q] [(-f|-F) freq_hz|-i interval_s]\n"
" %s [-q] (-f|-F) freq_hz|(-i|-I) interval_s\n"
" %s [-q] [(-f|-F) freq_hz|(-i|-I) interval_s] -c [active_s]\n"
" %s [-q] [(-f|-F) freq_hz|(-i|-I) interval_s]\n"
" [-C|-t 0|1... [-d debounce_s]] [-w wait_s] [-m mask] [-p]\n"
" file|pattern\n\n"
" -c output bus clock on CLK without sending a pattern\n"
@ -703,6 +703,7 @@ static void usage(const char *name)
" -F freq_hz like -f, but also allow \"overclocking\"\n"
" -i inter_s set bus clock such that one cycle equals the specified "
"interval\n"
" -I inter_s like -i, but also allow \"overclocking\"\n"
" -m mask use only the DATx lines specified in the mask (default: 0xf)\n"
" -p force interpretation of argument as pattern (and not file)\n"
" -q quiet. Don't pretty-print frequencies; don't report clock\n"
@ -749,7 +750,7 @@ int main(int argc, char **argv)
unsigned long tmp;
const char *p;
while ((c = getopt(argc, argv, "cCd:f:F:i:m:pqt:w:")) != EOF)
while ((c = getopt(argc, argv, "cCd:f:F:i:I:m:pqt:w:")) != EOF)
switch (c) {
case 'c':
clk_only = 1;
@ -772,6 +773,9 @@ int main(int argc, char **argv)
if (!frequency(optarg, &bus_hz, &bus_rel))
usage(*argv);
break;
case 'I':
all = 1;
/* fall through */
case 'i':
if (!interval(optarg, &bus_hz, &bus_rel))
usage(*argv);