mirror of
git://projects.qi-hardware.com/ben-blinkenlights.git
synced 2025-02-17 15:44:44 +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 struct pin *p;
|
||||||
const char *eq;
|
const char *eq;
|
||||||
|
|
||||||
|
if (!strcasecmp(s, "on"))
|
||||||
|
s = "nPWR=0";
|
||||||
|
else if (!strcasecmp(s, "off"))
|
||||||
|
s = "nPWR=1";
|
||||||
|
|
||||||
eq = strchr(s, '=');
|
eq = strchr(s, '=');
|
||||||
if (!eq)
|
if (!eq)
|
||||||
return 0;
|
return 0;
|
||||||
@ -117,9 +122,10 @@ static void usage(const char *name)
|
|||||||
{
|
{
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"usage: %s\n"
|
"usage: %s\n"
|
||||||
" %s name=value ...\n\n"
|
" %s name=value|action ...\n\n"
|
||||||
"Names: nPWR, CMD, CLK, DAT0, DAT1, DAT2, DAT3\n"
|
"Names: nPWR, CMD, CLK, DAT0, DAT1, DAT2, DAT3\n"
|
||||||
"Values: F, 0, 1, Z, R\n"
|
"Values: F, 0, 1, Z, R\n"
|
||||||
|
"Actions: ON, OFF\n"
|
||||||
, name, name);
|
, name, name);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user