lfn
serial
ticket/834-toolchain-update
topic/msim-upgrade
topic/simplify-dev-export
|
Last change
on this file since f0e25e8 was 602eac5, checked in by Jan Vesely <jano.vesely@…>, 15 years ago |
|
change ON/OFF to YES/NO for better readibility
|
-
Property mode
set to
100644
|
|
File size:
849 bytes
|
| Line | |
|---|
| 1 | #include <assert.h>
|
|---|
| 2 | #include <stdio.h>
|
|---|
| 3 |
|
|---|
| 4 | #include "debug.h"
|
|---|
| 5 | #include "port_status.h"
|
|---|
| 6 |
|
|---|
| 7 | struct flag_name
|
|---|
| 8 | {
|
|---|
| 9 | unsigned flag;
|
|---|
| 10 | const char *name;
|
|---|
| 11 | };
|
|---|
| 12 |
|
|---|
| 13 | static const struct flag_name flags[] =
|
|---|
| 14 | {
|
|---|
| 15 | { STATUS_SUSPEND, "suspended" },
|
|---|
| 16 | { STATUS_IN_RESET, "in reset" },
|
|---|
| 17 | { STATUS_LOW_SPEED, "low speed device" },
|
|---|
| 18 | { STATUS_ALWAYS_ONE, "always 1 bit" },
|
|---|
| 19 | { STATUS_RESUME, "resume" },
|
|---|
| 20 | { STATUS_LINE_D_MINUS, "line D- value" },
|
|---|
| 21 | { STATUS_LINE_D_PLUS, "line D+ value" },
|
|---|
| 22 | { STATUS_ENABLED_CHANGED, "enabled changed" },
|
|---|
| 23 | { STATUS_ENABLED, "enabled" },
|
|---|
| 24 | { STATUS_CONNECTED_CHANGED, "connected changed" },
|
|---|
| 25 | { STATUS_CONNECTED, "connected" }
|
|---|
| 26 | };
|
|---|
| 27 |
|
|---|
| 28 | void print_port_status(port_status_t value)
|
|---|
| 29 | {
|
|---|
| 30 | unsigned i = 0;
|
|---|
| 31 | for (;i < sizeof(flags)/sizeof(struct flag_name); ++i) {
|
|---|
| 32 | uhci_print_verbose("\t%s status: %s.\n", flags[i].name,
|
|---|
| 33 | value & flags[i].flag ? "YES" : "NO");
|
|---|
| 34 | }
|
|---|
| 35 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.