]> git.donarmstrong.com Git - tmk_firmware.git/commitdiff
Add keyboard report debug print on V-USB.
authortmk <nobody@nowhere>
Sun, 27 May 2012 05:17:48 +0000 (14:17 +0900)
committertmk <nobody@nowhere>
Sun, 27 May 2012 05:17:48 +0000 (14:17 +0900)
vusb/vusb.c

index 638611f3234c7ccf5313b95c5ee6deeb4871c7a1..0bfe21e92e2a272f14c665f0d2aa3e0be78acf5a 100644 (file)
@@ -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;
-       }
+        }
     }
 }