]> git.donarmstrong.com Git - tmk_firmware.git/blob - protocol/usb_hid/parser.cpp
Remove MCU dependent code from common/keyboard.c
[tmk_firmware.git] / protocol / usb_hid / parser.cpp
1 #include <cstring.h>
2
3 #include "parser.h"
4 #include "usb_hid.h"
5
6 #include "debug.h"
7
8
9 report_keyboard_t usb_hid_keyboard_report;
10 uint16_t usb_hid_time_stamp;
11
12
13 void KBDReportParser::Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)
14 {
15     ::memcpy(&usb_hid_keyboard_report, buf, sizeof(report_keyboard_t));
16     usb_hid_time_stamp = millis();
17
18     debug("KBDReport: ");
19     debug_hex(usb_hid_keyboard_report.mods);
20     debug(" --");
21     for (uint8_t i = 0; i < 6; i++) {
22         debug(" ");
23         debug_hex(usb_hid_keyboard_report.keys[i]);
24     }
25     debug("\r\n");
26 }