Skip to content

Commit d22fc55

Browse files
committed
change meaning of CFG_TUH_HID to total number of HID interfaces supported.
- previously CFG_TUH_HID is max number of interfaces per device which is rather limited and consume more resources than needed. - change hid host instance in API to index
1 parent 8a0b175 commit d22fc55

File tree

5 files changed

+217
-188
lines changed

5 files changed

+217
-188
lines changed

examples/dual/host_hid_to_device_cdc/src/tusb_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
// max device support (excluding hub device)
133133
#define CFG_TUH_DEVICE_MAX (CFG_TUH_HUB ? 4 : 1) // hub typically has 4 ports
134134

135-
#define CFG_TUH_HID 4
135+
#define CFG_TUH_HID (4*CFG_TUH_DEVICE_MAX)
136136
#define CFG_TUH_HID_EPIN_BUFSIZE 64
137137
#define CFG_TUH_HID_EPOUT_BUFSIZE 64
138138

examples/host/cdc_msc_hid/src/tusb_config.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
#if CFG_TUSB_MCU == OPT_MCU_RP2040
3838
// change to 1 if using pico-pio-usb as host controller for raspberry rp2040
39-
#define CFG_TUH_RPI_PIO_USB 0
39+
#define CFG_TUH_RPI_PIO_USB 1
4040
#define BOARD_TUH_RHPORT CFG_TUH_RPI_PIO_USB
4141
#endif
4242

@@ -97,7 +97,7 @@
9797

9898
#define CFG_TUH_HUB 1 // number of supported hubs
9999
#define CFG_TUH_CDC 1
100-
#define CFG_TUH_HID 4 // typical keyboard + mouse device can have 3-4 HID interfaces
100+
#define CFG_TUH_HID (4*CFG_TUH_DEVICE_MAX) // typical keyboard + mouse device can have 3-4 HID interfaces
101101
#define CFG_TUH_MSC 1
102102
#define CFG_TUH_VENDOR 0
103103

examples/host/hid_controller/src/tusb_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797

9898
#define CFG_TUH_HUB 0
9999
#define CFG_TUH_CDC 0
100-
#define CFG_TUH_HID 4 // typical keyboard + mouse device can have 3-4 HID interfaces
100+
#define CFG_TUH_HID (4*CFG_TUH_DEVICE_MAX) // typical keyboard + mouse device can have 3-4 HID interfaces
101101
#define CFG_TUH_MSC 0
102102
#define CFG_TUH_VENDOR 0
103103

0 commit comments

Comments
 (0)