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.

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