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 603B

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