1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2024-12-28 03:46:48 +02:00

ubbctl/ubbctl.c (main): move pin status display to separate function

This commit is contained in:
Werner Almesberger 2013-01-06 09:07:16 -03:00
parent fe96b3b297
commit e6a0e42296

View File

@ -32,11 +32,10 @@ static struct pin {
};
int main(int argc, char **argv)
static void show_pins(void)
{
const struct pin *p;
ubb_open(UBB_ALL);
for (p = pins; p->name; p++) {
printf("%s%s=", p == pins ? "" : " ", p->name);
if (PDFUN & p->mask)
@ -48,5 +47,12 @@ int main(int argc, char **argv)
}
printf("\n");
}
int main(int argc, char **argv)
{
ubb_open(UBB_ALL);
show_pins();
return 0;
}