mirror of
git://projects.qi-hardware.com/ben-blinkenlights.git
synced 2024-11-27 17:05:20 +02:00
ubbctl/ubbctl.c: add actions "on" and "off" to control nPWR
This commit is contained in:
parent
246a8a0a5f
commit
fd5707ee72
@ -69,6 +69,11 @@ static int setup_pin(const char *s, int doit)
|
||||
const struct pin *p;
|
||||
const char *eq;
|
||||
|
||||
if (!strcasecmp(s, "on"))
|
||||
s = "nPWR=0";
|
||||
else if (!strcasecmp(s, "off"))
|
||||
s = "nPWR=1";
|
||||
|
||||
eq = strchr(s, '=');
|
||||
if (!eq)
|
||||
return 0;
|
||||
@ -117,9 +122,10 @@ static void usage(const char *name)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"usage: %s\n"
|
||||
" %s name=value ...\n\n"
|
||||
" %s name=value|action ...\n\n"
|
||||
"Names: nPWR, CMD, CLK, DAT0, DAT1, DAT2, DAT3\n"
|
||||
"Values: F, 0, 1, Z, R\n"
|
||||
"Actions: ON, OFF\n"
|
||||
, name, name);
|
||||
exit(1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user