1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-22 14:04:59 +02:00

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'
This commit is contained in:
Werner Almesberger 2011-06-05 21:47:02 -03:00
parent e9debdd4ab
commit 33b0400e53
3 changed files with 9 additions and 7 deletions

View File

@ -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':

View File

@ -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]);

View File

@ -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':