1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2024-11-04 22:53:08 +02:00

ubbctl/ubbctl.c (show_pins): also show level seen at pin

This commit is contained in:
Werner Almesberger 2013-01-06 10:00:52 -03:00
parent 33085cee44
commit 77fd696067

View File

@ -37,15 +37,22 @@ static struct pin {
static void show_pins(void)
{
const struct pin *p;
int pin, set;
for (p = pins; p->name; p++) {
printf("%s%s=", p == pins ? "" : " ", p->name);
if (PDFUN & p->mask)
pin = PIN(p->mask);
if (PDFUN & p->mask) {
printf("FN");
else if (PDDIR & p->mask)
printf("%d", !!(PDDAT & p->mask));
else
} else if (PDDIR & p->mask) {
set = !!(PDDAT & p->mask);
if (pin != set)
printf("%d!", set);
} else {
putchar(PDPULL & p->mask ? 'Z' : 'R');
}
printf("%d", pin);
}
printf("\n");
}