diff options
author | tmk <nobody@nowhere> | 2012-05-27 14:17:48 +0900 |
---|---|---|
committer | tmk <nobody@nowhere> | 2012-05-27 14:17:48 +0900 |
commit | 7be605cce75ea572cd2eb62dca03e14d161ef467 (patch) | |
tree | da097fd4055d8f38e442111546e3815667ba6da6 | |
parent | fe7152344308f4752f7bb5180144c47251dae233 (diff) |
Add keyboard report debug print on V-USB.
-rw-r--r-- | vusb/vusb.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/vusb/vusb.c b/vusb/vusb.c index 638611f323..0bfe21e92e 100644 --- a/vusb/vusb.c +++ b/vusb/vusb.c @@ -40,10 +40,15 @@ static uint8_t kbuf_tail = 0; void vusb_transfer_keyboard(void) { if (usbInterruptIsReady()) { - if (kbuf_head != kbuf_tail) { + if (kbuf_head != kbuf_tail) { usbSetInterrupt((void *)&kbuf[kbuf_tail], sizeof(report_keyboard_t)); + if (!debug_keyboard) { + print("keys: "); + for (int i = 0; i < REPORT_KEYS; i++) { phex(kbuf[kbuf_tail].keys[i]); print(" "); } + print(" mods: "); phex((kbuf[kbuf_tail]).mods); print("\n"); + } kbuf_tail = (kbuf_tail + 1) % KBUF_SIZE; - } + } } } |