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;
}
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());
}
}
}
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)
#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
// 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;
}