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