mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2024-11-22 19:20:41 +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:
parent
e9debdd4ab
commit
33b0400e53
@ -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':
|
||||
|
@ -120,7 +120,7 @@ static void usage(const char *name)
|
||||
" 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"
|
||||
" 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());
|
||||
@ -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]);
|
||||
|
@ -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':
|
||||
|
Loading…
Reference in New Issue
Block a user