1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-26 12:16:14 +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; expect |= bit;
/* fall through */ /* fall through */
case 'l': case 'l':
case 'o':
read |= bit; read |= bit;
/* fall through */ /* fall through */
case 'z': case 'z':

View File

@ -120,7 +120,7 @@ static void usage(const char *name)
" pattern is a sequence of the following characters:\n" " pattern is a sequence of the following characters:\n"
" 0 = output a strong 0 1 = output a strong 1\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 = 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" " 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" " Z = pull up, don't read z = no pull-up, don't read\n"
" x = don't care . = separator\n" " x = don't care . = separator\n"
, name, atrf_default_driver_name()); , name, atrf_default_driver_name());
@ -134,7 +134,7 @@ static void usage(const char *name)
* H pull-up, read 1 * H pull-up, read 1
* L pull-up, read 0 * L pull-up, read 0
* h no pull-up, read 1 * 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 pull-up, don't read
* z no pull-up, don't read * z no pull-up, don't read
* x don't care * x don't care
@ -168,7 +168,7 @@ int main(int argc, char *const *argv)
if (reg_op(NULL, argv[i], 0)) if (reg_op(NULL, argv[i], 0))
continue; continue;
for (s = argv[i]; *s; s++) for (s = argv[i]; *s; s++)
if (!strchr("01HLhlZzx.", *s)) if (!strchr("01HLhloZzx.", *s))
fprintf(stderr, fprintf(stderr,
"invalid configuration '%c' in \"%s\"\n", "invalid configuration '%c' in \"%s\"\n",
*s, argv[i]); *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; expect[port] |= bit;
/* fall through */ /* fall through */
case 'l': case 'l':
case 'o':
read[port] |= bit; read[port] |= bit;
/* fall through */ /* fall through */
case 'z': case 'z':