]> git.friedersdorff.com Git - max/tmk_keyboard.git/commitdiff
usb_usb: Clean print for debug
authortmk <hasu@tmk-kbd.com>
Wed, 18 Sep 2019 06:29:38 +0000 (15:29 +0900)
committertmk <hasu@tmk-kbd.com>
Wed, 18 Sep 2019 06:29:38 +0000 (15:29 +0900)
converter/usb_usb/usb_usb.cpp
tmk_core/protocol/usb_hid/parser.cpp

index 50d2578ee1495c4ed1b7c4bb78aa4ddc34e4f2c7..9277cece3cdef4b48d10a2dcea438a92e4e2cbc3 100644 (file)
@@ -140,12 +140,6 @@ uint8_t matrix_scan(void) {
         or_report(kbd_parser4.report);
 
         matrix_is_mod = true;
-
-        dprintf("state:  %02X %02X", keyboard_report.mods, keyboard_report.reserved);
-        for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) {
-            dprintf(" %02X", keyboard_report.keys[i]);
-        }
-        dprint("\r\n");
     } else {
         matrix_is_mod = false;
     }
@@ -155,17 +149,17 @@ uint8_t matrix_scan(void) {
     usb_host.Task();
     timer = timer_elapsed(timer);
     if (timer > 100) {
-        dprintf("host.Task: %d\n", timer);
+        xprintf("host.Task: %d\n", timer);
     }
 
     static uint8_t usb_state = 0;
     if (usb_state != usb_host.getUsbTaskState()) {
         usb_state = usb_host.getUsbTaskState();
-        dprintf("usb_state: %02X\n", usb_state);
+        xprintf("usb_state: %02X\n", usb_state);
 
         // restore LED state when keyboard comes up
         if (usb_state == USB_STATE_RUNNING) {
-            dprintf("speed: %s\n", usb_host.getVbusState()==FSHOST ? "full" : "low");
+            xprintf("speed: %s\n", usb_host.getVbusState()==FSHOST ? "full" : "low");
             keyboard_set_leds(host_keyboard_leds());
         }
     }
@@ -222,12 +216,6 @@ uint8_t matrix_key_count(void) {
 }
 
 void matrix_print(void) {
-    print("\nr/c 0123456789ABCDEF\n");
-    for (uint8_t row = 0; row < matrix_rows(); row++) {
-        xprintf("%02d: ", row);
-        print_bin_reverse16(matrix_get_row(row));
-        print("\n");
-    }
 }
 
 void led_set(uint8_t usb_led)
index 5e9a3efb90c3b06497710bac813888f5482a6278..bc2744d0f5e451fc75199327b6f9a1e4b10676eb 100644 (file)
@@ -1,16 +1,16 @@
 #include "parser.h"
 #include "usb_hid.h"
 
-#include "debug.h"
+#include "print.h"
 
 
 void KBDReportParser::Parse(USBHID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)
 {
-    dprintf("input %d:", hid->GetAddress());
+    xprintf("input %d:", hid->GetAddress());
     for (uint8_t i = 0; i < len; i++) {
-        dprintf(" %02X", buf[i]);
+        xprintf(" %02X", buf[i]);
     }
-    dprint("\r\n");
+    xprintf("\r\n");
 
     // Rollover error
     // Cherry: 0101010101010101
@@ -18,7 +18,7 @@ void KBDReportParser::Parse(USBHID *hid, bool is_rpt_id, uint8_t len, uint8_t *b
     // Apple:  0000010101010101
     // https://geekhack.org/index.php?topic=69169.msg2760969#msg2760969
     if (buf[2] == 0x01) {
-       dprint("Rollover error: ignored\r\n");
+       xprintf("Rollover error: ignored\r\n");
        return;
     }