]> git.donarmstrong.com Git - qmk_firmware.git/blob - tmk_core/protocol/usb_hid/parser.cpp
Merge commit 'a074364c3731d66b56d988c8a6c960a83ea0e0a1' as 'tmk_core'
[qmk_firmware.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 report_keyboard_t usb_hid_keyboard_report;
8 uint16_t usb_hid_time_stamp;
9
10
11 void KBDReportParser::Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)
12 {
13     ::memcpy(&usb_hid_keyboard_report, buf, sizeof(report_keyboard_t));
14     usb_hid_time_stamp = millis();
15
16     debug("KBDReport: ");
17     debug_hex(usb_hid_keyboard_report.mods);
18     debug(" --");
19     for (uint8_t i = 0; i < 6; i++) {
20         debug(" ");
21         debug_hex(usb_hid_keyboard_report.keys[i]);
22     }
23     debug("\r\n");
24 }