Keyboard firmwares for Atmel AVR and Cortex-M
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

parser.cpp 554B

123456789101112131415161718192021222324
  1. #include "parser.h"
  2. #include "usb_hid.h"
  3. #include "debug.h"
  4. report_keyboard_t usb_hid_keyboard_report;
  5. uint16_t usb_hid_time_stamp;
  6. void KBDReportParser::Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)
  7. {
  8. ::memcpy(&usb_hid_keyboard_report, buf, sizeof(report_keyboard_t));
  9. usb_hid_time_stamp = millis();
  10. debug("KBDReport: ");
  11. debug_hex(usb_hid_keyboard_report.mods);
  12. debug(" --");
  13. for (uint8_t i = 0; i < 6; i++) {
  14. debug(" ");
  15. debug_hex(usb_hid_keyboard_report.keys[i]);
  16. }
  17. debug("\r\n");
  18. }