usb_usb: Clean print for debug

This commit is contained in:
tmk 2019-09-18 15:29:38 +09:00
parent 13e115b352
commit 108b0ce8d9
2 changed files with 8 additions and 20 deletions

View 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)

View 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;
}