summaryrefslogtreecommitdiff
path: root/examples/host/hid_controller
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2023-03-17 15:27:56 +0700
committerGitHub <[email protected]>2023-03-17 15:27:56 +0700
commit16daad81643279ffc951ba11a531877dfee8c872 (patch)
tree8b906cc9e51b0ad614b6982bd0edc9789218ca5f /examples/host/hid_controller
parent96d064e923dbc1c86a247ada0395923667cca468 (diff)
parent511f5be8b34f0a28b20773f2d39bda575f07065f (diff)
Merge pull request #1960 from hathach/fix-host-enumerate-mul-device
Fix host enumerate multiple devices from multiple host controllers
Diffstat (limited to 'examples/host/hid_controller')
-rw-r--r--examples/host/hid_controller/CMakeLists.txt5
-rw-r--r--examples/host/hid_controller/src/tusb_config.h7
2 files changed, 8 insertions, 4 deletions
diff --git a/examples/host/hid_controller/CMakeLists.txt b/examples/host/hid_controller/CMakeLists.txt
index aa50b5a52..ac3070b82 100644
--- a/examples/host/hid_controller/CMakeLists.txt
+++ b/examples/host/hid_controller/CMakeLists.txt
@@ -26,3 +26,8 @@ target_include_directories(${PROJECT} PUBLIC
# Configure compilation flags and libraries for the example... see the corresponding function
# in hw/bsp/FAMILY/family.cmake for details.
family_configure_host_example(${PROJECT})
+
+# Add pico-pio-usb for rp2040 since user can choose to run on bit-banging host
+if(FAMILY STREQUAL "rp2040")
+ family_add_pico_pio_usb(${PROJECT})
+endif()
diff --git a/examples/host/hid_controller/src/tusb_config.h b/examples/host/hid_controller/src/tusb_config.h
index e6d6f873d..2e0dd0dbe 100644
--- a/examples/host/hid_controller/src/tusb_config.h
+++ b/examples/host/hid_controller/src/tusb_config.h
@@ -1,4 +1,4 @@
-/*
+/*
* The MIT License (MIT)
*
* Copyright (c) 2019 Ha Thach (tinyusb.org)
@@ -101,9 +101,8 @@
#define CFG_TUH_MSC 0
#define CFG_TUH_VENDOR 0
-// max device support (excluding hub device)
-// 1 hub typically has 4 ports
-#define CFG_TUH_DEVICE_MAX (CFG_TUH_HUB ? 4 : 1)
+// max device support (excluding hub device): 1 hub typically has 4 ports
+#define CFG_TUH_DEVICE_MAX (3*CFG_TUH_HUB + 1)
//------------- HID -------------//