Date:2013-01-15 18:24:00 (11 years 2 months ago)
Author:Werner Almesberger
Commit:1111156a971319edcd5dc719a8123524677b869e
Message:ubb-patgen/ubb-patgen.c: remove pattern frequency and use -f for bus clock

Let's leave fancy oversampling calculations to the user.
Files: ubb-patgen/ubb-patgen.c (4 diffs)

Change Details

ubb-patgen/ubb-patgen.c
443443{
444444        fprintf(stderr,
445445"usage: %s\n"
446" %s [-b freq_hz] [-f freq_hz] -c [-q] [active_s]\n"
447" %s [-b freq_hz] [-f freq_hz] [-C] [-q] pattern\n\n"
448" -b freq_hz set bus clock to the specified frequency (default: 1 MHz)\n"
446" %s [-f freq_hz] -c [-q] [active_s]\n"
447" %s [-f freq_hz] [-C] [-q] pattern\n\n"
449448" -c output bus clock on CLK without sending a pattern\n"
450449" -C temporarily output bus clock on CLK (for debugging)\n"
451" -f freq_hz set pattern rate (default: same as bus clock)\n"
450" -f freq_hz set bus clock to the specified frequency (default: 1 MHz)\n"
452451" -q quiet. Don't report clock differences.\n\n"
453452" active_s keep running that many seconds after setting the clock\n"
454453" (default: exit immediately but leave the clock on)\n"
...... 
468467{
469468    struct mmcclk clk;
470469    int bus_hz = 0, clk_only = 0, clkout = 0, bus_rel = 0;
471    int pattern_hz = 0, pattern_rel = 0;
472470    const char *pattern = NULL;
473471    int quiet = 0;
474472    double active_s = 0;
...... 
477475    char *end;
478476    int c;
479477
480    while ((c = getopt(argc, argv, "b:cCq")) != EOF)
478    while ((c = getopt(argc, argv, "cCf:q")) != EOF)
481479        switch (c) {
482        case 'b':
483            if (!frequency(optarg, &bus_hz, &bus_rel))
484                usage(*argv);
485            break;
486480        case 'f':
487            if (!frequency(optarg, &pattern_hz, &pattern_rel))
481            if (!frequency(optarg, &bus_hz, &bus_rel))
488482                usage(*argv);
489483            break;
490484        case 'c':
...... 
504498    case 0:
505499        if (clk_only)
506500            break;
507        if (bus_hz || pattern_hz || clkout || quiet)
501        if (bus_hz || clkout || quiet)
508502            usage(*argv);
509503        ubb_open(UBB_ALL);
510504        show_frequencies();

Archive Download the corresponding diff file

Branches:
master



interactive