diff options
| author | graham sanderson <[email protected]> | 2021-01-19 19:52:07 -0600 |
|---|---|---|
| committer | graham sanderson <[email protected]> | 2021-01-19 19:52:07 -0600 |
| commit | e0aa405d19e35dbf58cf502b8106455c1a3c2a5c (patch) | |
| tree | cd3b5538e119a9e7854a3d6b50e38042f3c690b6 /src/class | |
| parent | 589dfdb0e58fe6630f2b67c49c7f682ac51aba8f (diff) | |
RP2040 support
Diffstat (limited to 'src/class')
| -rw-r--r-- | src/class/hid/hid_host.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/class/hid/hid_host.c b/src/class/hid/hid_host.c index a96eb6276..64d1b8e5d 100644 --- a/src/class/hid/hid_host.c +++ b/src/class/hid/hid_host.c @@ -39,6 +39,7 @@ typedef struct { uint8_t itf_num; uint8_t ep_in; uint8_t ep_out; + bool valid; uint16_t report_size; }hidh_interface_t; @@ -53,6 +54,7 @@ static inline bool hidh_interface_open(uint8_t rhport, uint8_t dev_addr, uint8_t p_hid->ep_in = p_endpoint_desc->bEndpointAddress; p_hid->report_size = p_endpoint_desc->wMaxPacketSize.size; // TODO get size from report descriptor p_hid->itf_num = interface_number; + p_hid->valid = true; return true; } @@ -246,14 +248,14 @@ bool hidh_set_config(uint8_t dev_addr, uint8_t itf_num) usbh_driver_set_config_complete(dev_addr, itf_num); #if CFG_TUH_HID_KEYBOARD - if ( keyboardh_data[dev_addr-1].itf_num == itf_num) + if (( keyboardh_data[dev_addr-1].itf_num == itf_num) && keyboardh_data[dev_addr-1].valid) { tuh_hid_keyboard_mounted_cb(dev_addr); } #endif #if CFG_TUH_HID_MOUSE - if ( mouseh_data[dev_addr-1].ep_in == itf_num ) + if (( mouseh_data[dev_addr-1].ep_in == itf_num ) && mouseh_data[dev_addr-1].valid) { tuh_hid_mouse_mounted_cb(dev_addr); } |
