fix(hid): Fix OUTPUT report not received (#10398)
Fixes an issue where the keyboard LEDs will not trigger the proper event
This commit is contained in:
parent
cd971319cb
commit
2ec5584d06
2 changed files with 10 additions and 2 deletions
|
|
@ -453,7 +453,15 @@ __attribute__((weak)) int32_t tud_msc_scsi_cb(uint8_t lun, uint8_t const scsi_cm
|
|||
__attribute__((weak)) bool tud_msc_is_writable_cb(uint8_t lun) {
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
#if CFG_TUD_NCM
|
||||
__attribute__((weak)) bool tud_network_recv_cb(const uint8_t *src, uint16_t size) {
|
||||
return false;
|
||||
}
|
||||
__attribute__((weak)) uint16_t tud_network_xmit_cb(uint8_t *dst, void *ref, uint16_t arg) {
|
||||
return 0;
|
||||
}
|
||||
__attribute__((weak)) void tud_network_init_cb(void) {}
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ uint16_t tud_hid_get_report_cb(uint8_t instance, uint8_t report_id, hid_report_t
|
|||
// Invoked when received SET_REPORT control request or
|
||||
// received data on OUT endpoint ( Report ID = 0, Type = 0 )
|
||||
void tud_hid_set_report_cb(uint8_t instance, uint8_t report_id, hid_report_type_t report_type, uint8_t const *buffer, uint16_t bufsize) {
|
||||
if (!report_id && !report_type) {
|
||||
if (!report_id && (!report_type || report_type == HID_REPORT_TYPE_OUTPUT)) {
|
||||
if (!tinyusb_on_set_output(0, buffer, bufsize) && !tinyusb_on_set_output(buffer[0], buffer + 1, bufsize - 1)) {
|
||||
log_d(
|
||||
"instance: %u, report_id: %u, report_type: %s, bufsize: %u", instance, buffer[0], tinyusb_hid_device_report_types[HID_REPORT_TYPE_OUTPUT], bufsize - 1
|
||||
|
|
|
|||
Loading…
Reference in a new issue