mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2024-11-29 11:11:53 +02:00
atrf-xtal.c (usage, main): renamed option "d" (dump) to "r" (dump raw)
This commit is contained in:
parent
adc14c4742
commit
1830454b49
@ -83,8 +83,8 @@ static void eval(unsigned *res, int rep)
|
|||||||
static void usage(const char *name)
|
static void usage(const char *name)
|
||||||
{
|
{
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"%s [-d] [-s size] [-t trim] [repetitions]\n"
|
"%s [-r] [-s size] [-t trim] [repetitions]\n"
|
||||||
" -d instead of printing a mean value, dump all samples\n"
|
" -r instead of printing a mean value, dump the raw samples\n"
|
||||||
" -s size payload size in bytes, 0-127 (default: %d bytes)\n"
|
" -s size payload size in bytes, 0-127 (default: %d bytes)\n"
|
||||||
" -t trim trim capacitor setting, 0-15 (default: %d)\n"
|
" -t trim trim capacitor setting, 0-15 (default: %d)\n"
|
||||||
" repetitions number of measurements (default: 1)\n"
|
" repetitions number of measurements (default: 1)\n"
|
||||||
@ -99,15 +99,15 @@ int main(int argc, char *const *argv)
|
|||||||
int size = DEFAULT_SIZE;
|
int size = DEFAULT_SIZE;
|
||||||
int trim = DEFAULT_TRIM;
|
int trim = DEFAULT_TRIM;
|
||||||
int rep = 1;
|
int rep = 1;
|
||||||
int dump = 0;
|
int dump_raw = 0;
|
||||||
char *end;
|
char *end;
|
||||||
unsigned *res;
|
unsigned *res;
|
||||||
int c, i;
|
int c, i;
|
||||||
|
|
||||||
while ((c = getopt(argc, argv, "ds:t:")) != EOF)
|
while ((c = getopt(argc, argv, "rs:t:")) != EOF)
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'd':
|
case 'r':
|
||||||
dump = 1;
|
dump_raw = 1;
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
size = strtoul(optarg, &end, 0);
|
size = strtoul(optarg, &end, 0);
|
||||||
@ -158,7 +158,7 @@ int main(int argc, char *const *argv)
|
|||||||
|
|
||||||
atrf_close(dsc);
|
atrf_close(dsc);
|
||||||
|
|
||||||
if (dump) {
|
if (dump_raw) {
|
||||||
for (i = 0; i != rep; i++)
|
for (i = 0; i != rep; i++)
|
||||||
printf("%u\n", res[i]);
|
printf("%u\n", res[i]);
|
||||||
exit(0);
|
exit(0);
|
||||||
|
Loading…
Reference in New Issue
Block a user