From: tmk Date: Wed, 18 Sep 2019 06:29:38 +0000 (+0900) Subject: usb_usb: Clean print for debug X-Git-Url: https://git.friedersdorff.com/?a=commitdiff_plain;ds=sidebyside;h=108b0ce8d9b6635c81d6fc1350a50efc6458d695;p=max%2Ftmk_keyboard.git usb_usb: Clean print for debug --- diff --git a/converter/usb_usb/usb_usb.cpp b/converter/usb_usb/usb_usb.cpp index 50d2578e..9277cece 100644 --- a/converter/usb_usb/usb_usb.cpp +++ b/converter/usb_usb/usb_usb.cpp @@ -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) diff --git a/tmk_core/protocol/usb_hid/parser.cpp b/tmk_core/protocol/usb_hid/parser.cpp index 5e9a3efb..bc2744d0 100644 --- a/tmk_core/protocol/usb_hid/parser.cpp +++ b/tmk_core/protocol/usb_hid/parser.cpp @@ -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; }