diff options
author | tmk <nobody@nowhere> | 2012-08-27 15:18:01 +0900 |
---|---|---|
committer | tmk <nobody@nowhere> | 2012-08-28 21:56:15 +0900 |
commit | e7c030375ac76907206db7f09cf9208b0c7c6e66 (patch) | |
tree | 8260eec8ca2fcd2124c210a8488d51dd0ae8afaf /protocol/usb_hid/parser.cpp | |
parent | c5060ea81942b0e3f8577536ff78402a19abe3d3 (diff) | |
download | qmk_firmware-e7c030375ac76907206db7f09cf9208b0c7c6e66.tar.gz qmk_firmware-e7c030375ac76907206db7f09cf9208b0c7c6e66.zip |
Add USB to USB converter. unmature.
Diffstat (limited to 'protocol/usb_hid/parser.cpp')
-rw-r--r-- | protocol/usb_hid/parser.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/protocol/usb_hid/parser.cpp b/protocol/usb_hid/parser.cpp index b03af8ae4..4077444b7 100644 --- a/protocol/usb_hid/parser.cpp +++ b/protocol/usb_hid/parser.cpp | |||
@@ -1,14 +1,27 @@ | |||
1 | #include <cstring.h> | ||
2 | |||
1 | #include "parser.h" | 3 | #include "parser.h" |
4 | #include "usb_hid.h" | ||
5 | |||
2 | #include "leonardo_led.h" | 6 | #include "leonardo_led.h" |
3 | #include "debug.h" | 7 | #include "debug.h" |
4 | 8 | ||
9 | |||
10 | report_keyboard_t usb_hid_keyboard_report; | ||
11 | uint16_t usb_hid_time_stamp; | ||
12 | |||
13 | |||
5 | void KBDReportParser::Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf) | 14 | void KBDReportParser::Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf) |
6 | { | 15 | { |
16 | ::memcpy(&usb_hid_keyboard_report, buf, sizeof(report_keyboard_t)); | ||
17 | usb_hid_time_stamp = millis(); | ||
18 | |||
7 | LED_TX_TOGGLE; | 19 | LED_TX_TOGGLE; |
8 | debug("KBDReport: "); | 20 | debug("KBDReport: "); |
9 | for (uint8_t i = 0; i < len; i++) { | 21 | debug_hex(usb_hid_keyboard_report.mods); |
10 | debug_hex(buf[i]); | 22 | for (uint8_t i = 0; i < 6; i++) { |
11 | debug(" "); | 23 | debug(" "); |
24 | debug_hex(usb_hid_keyboard_report.keys[i]); | ||
12 | } | 25 | } |
13 | debug("\r\n"); | 26 | debug("\r\n"); |
14 | } | 27 | } |