]> git.friedersdorff.com Git - max/tmk_keyboard.git/blob - tmk_core/protocol/usb_hid/parser.cpp
usb_usb: usb_hid: Change for USB_Host_Shield_2.0
[max/tmk_keyboard.git] / tmk_core / protocol / usb_hid / parser.cpp
1 #include "parser.h"
2 #include "usb_hid.h"
3
4 #include "debug.h"
5
6
7 void KBDReportParser::Parse(USBHID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)
8 {
9     dprintf("input %d:", hid->GetAddress());
10     for (uint8_t i = 0; i < len; i++) {
11         dprintf(" %02X", buf[i]);
12     }
13     dprint("\r\n");
14
15     // ignore Cherry 0101010101010101 bug report
16     // https://geekhack.org/index.php?topic=69169.msg2638223#msg2638223
17     if (buf[1] == 0x01) {
18        dprint("Cherry bug: ignored\r\n");
19        return;
20     }
21
22     ::memcpy(&report, buf, sizeof(report_keyboard_t));
23     time_stamp = millis();
24 }