From 81efcf7d9b69719cafeac04b9a81d090fab72812 Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 26 Apr 2019 01:04:06 +0700 Subject: [PATCH] enable usbd hid in core --- .../tinyusb/src/class/hid/hid_device.h | 6 +++--- cores/nRF5/usb/tusb_config.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cores/nRF5/usb/Adafruit_TinyUSB_core/tinyusb/src/class/hid/hid_device.h b/cores/nRF5/usb/Adafruit_TinyUSB_core/tinyusb/src/class/hid/hid_device.h index f72be61e..42d81f3c 100644 --- a/cores/nRF5/usb/Adafruit_TinyUSB_core/tinyusb/src/class/hid/hid_device.h +++ b/cores/nRF5/usb/Adafruit_TinyUSB_core/tinyusb/src/class/hid/hid_device.h @@ -60,13 +60,13 @@ bool tud_hid_report(uint8_t report_id, void const* report, uint8_t len); // Invoked when receiving GET_REPORT control request // Application must fill buffer report's content and return its length. // Return zero will cause the stack to STALL request -uint16_t tud_hid_get_report_cb(uint8_t report_id, hid_report_type_t report_type, uint8_t* buffer, uint16_t reqlen); +ATTR_WEAK uint16_t tud_hid_get_report_cb(uint8_t report_id, hid_report_type_t report_type, uint8_t* buffer, uint16_t reqlen); // Invoked when receiving SET_REPORT control request -void tud_hid_set_report_cb(uint8_t report_id, hid_report_type_t report_type, uint8_t const* buffer, uint16_t bufsize); +ATTR_WEAK void tud_hid_set_report_cb(uint8_t report_id, hid_report_type_t report_type, uint8_t const* buffer, uint16_t bufsize); // Invoked when host switch mode Boot <-> Report via SET_PROTOCOL request -void tud_hid_mode_changed_cb(uint8_t boot_mode) ATTR_WEAK; +ATTR_WEAK void tud_hid_mode_changed_cb(uint8_t boot_mode); //--------------------------------------------------------------------+ // KEYBOARD API diff --git a/cores/nRF5/usb/tusb_config.h b/cores/nRF5/usb/tusb_config.h index 66c8e726..c98bb996 100644 --- a/cores/nRF5/usb/tusb_config.h +++ b/cores/nRF5/usb/tusb_config.h @@ -55,7 +55,7 @@ //------------- CLASS -------------// #define CFG_TUD_CDC 1 #define CFG_TUD_MSC 1 -#define CFG_TUD_HID 0 +#define CFG_TUD_HID 1 #define CFG_TUD_MIDI 0 #define CFG_TUD_CUSTOM_CLASS 0