From 33b0400e5314c36716a5807d88da24f5411b7cee Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Sun, 5 Jun 2011 21:47:02 -0300 Subject: [PATCH] atrf-gpio: accept 'o' as an alias for 'l' This, while being slightly unsystematic, reduces the risk of confusing "1" (one) and "l" (lower-case ell). - tools/atrf-gpio/atben.c (do_atben), tools/atrf-gpio/atusb.c (do_atusb): treat 'o' as an alias of 'l' - tools/atrf-gpio/atrf-gpio.c (usage): list 'o' as alternative for 'l' --- tools/atrf-gpio/atben.c | 1 + tools/atrf-gpio/atrf-gpio.c | 14 +++++++------- tools/atrf-gpio/atusb.c | 1 + 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/tools/atrf-gpio/atben.c b/tools/atrf-gpio/atben.c index fa6f946..4b71abe 100644 --- a/tools/atrf-gpio/atben.c +++ b/tools/atrf-gpio/atben.c @@ -159,6 +159,7 @@ void do_atben(struct atrf_dsc *dsc, const char *pattern, const char *next) expect |= bit; /* fall through */ case 'l': + case 'o': read |= bit; /* fall through */ case 'z': diff --git a/tools/atrf-gpio/atrf-gpio.c b/tools/atrf-gpio/atrf-gpio.c index d2f5042..f48ddb3 100644 --- a/tools/atrf-gpio/atrf-gpio.c +++ b/tools/atrf-gpio/atrf-gpio.c @@ -118,11 +118,11 @@ static void usage(const char *name) " addr/value read and verify one byte from SRAM\n" " #... comment\n\n" " pattern is a sequence of the following characters:\n" -" 0 = output a strong 0 1 = output a strong 1\n" -" L = pull up, expect to read 0 H = pull up, expect to read 1\n" -" l = no pull-up, expect to read 0 h = no pull-up, expect to read 1\n" -" Z = pull up, don't read z = no pull-up, don't read\n" -" x = don't care . = separator\n" +" 0 = output a strong 0 1 = output a strong 1\n" +" L = pull up, expect to read 0 H = pull up, expect to read 1\n" +" l/o = no pull-up, expect to read 0 h = no pull-up, expect to read 1\n" +" Z = pull up, don't read z = no pull-up, don't read\n" +" x = don't care . = separator\n" , name, atrf_default_driver_name()); exit(1); } @@ -134,7 +134,7 @@ static void usage(const char *name) * H pull-up, read 1 * L pull-up, read 0 * h no pull-up, read 1 - * l no pull-up, read 0 + * l/o no pull-up, read 0 * Z pull-up, don't read * z no pull-up, don't read * x don't care @@ -168,7 +168,7 @@ int main(int argc, char *const *argv) if (reg_op(NULL, argv[i], 0)) continue; for (s = argv[i]; *s; s++) - if (!strchr("01HLhlZzx.", *s)) + if (!strchr("01HLhloZzx.", *s)) fprintf(stderr, "invalid configuration '%c' in \"%s\"\n", *s, argv[i]); diff --git a/tools/atrf-gpio/atusb.c b/tools/atrf-gpio/atusb.c index e30db9f..c8a2553 100644 --- a/tools/atrf-gpio/atusb.c +++ b/tools/atrf-gpio/atusb.c @@ -160,6 +160,7 @@ void do_atusb(struct atrf_dsc *dsc, const char *pattern, const char *next) expect[port] |= bit; /* fall through */ case 'l': + case 'o': read[port] |= bit; /* fall through */ case 'z':