diff options
| author | Gordon McNab <[email protected]> | 2021-12-08 08:36:43 +0000 |
|---|---|---|
| committer | Gordon McNab <[email protected]> | 2021-12-08 08:36:43 +0000 |
| commit | 9a7db985931ae215e808d40e7bacd52535d45305 (patch) | |
| tree | a4d75e2c3823766da53a006280c0d805630d996e /examples/host | |
| parent | edf3f3501656b010ad4a9e1d0a0d62573dd0b3fb (diff) | |
| parent | cde824f17f73b5ce4fcec8c176827297854a76c2 (diff) | |
Merge branch 'master' into port-ft90x
Diffstat (limited to 'examples/host')
| -rw-r--r-- | examples/host/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | examples/host/cdc_msc_hid/.only.MCU_MSP432E4 | 0 | ||||
| -rw-r--r-- | examples/host/cdc_msc_hid/Makefile | 5 | ||||
| -rw-r--r-- | examples/host/hid_controller/.only.MCU_MSP432E4 | 0 | ||||
| -rw-r--r-- | examples/host/hid_controller/Makefile | 7 | ||||
| -rw-r--r-- | examples/host/hid_controller/src/hid_app.c | 8 | ||||
| -rw-r--r-- | examples/host/hid_controller/src/main.c | 1 |
7 files changed, 14 insertions, 8 deletions
diff --git a/examples/host/CMakeLists.txt b/examples/host/CMakeLists.txt index f185ac4f8..5c63ec0c0 100644 --- a/examples/host/CMakeLists.txt +++ b/examples/host/CMakeLists.txt @@ -7,3 +7,4 @@ family_initialize_project(tinyusb_host_examples ${CMAKE_CURRENT_LIST_DIR}) # family_add_subdirectory will filter what to actually add based on selected FAMILY family_add_subdirectory(cdc_msc_hid) +family_add_subdirectory(hid_controller) diff --git a/examples/host/cdc_msc_hid/.only.MCU_MSP432E4 b/examples/host/cdc_msc_hid/.only.MCU_MSP432E4 new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/examples/host/cdc_msc_hid/.only.MCU_MSP432E4 diff --git a/examples/host/cdc_msc_hid/Makefile b/examples/host/cdc_msc_hid/Makefile index 6a2b4d902..ce0dd1a40 100644 --- a/examples/host/cdc_msc_hid/Makefile +++ b/examples/host/cdc_msc_hid/Makefile @@ -9,7 +9,8 @@ INC += \ EXAMPLE_SOURCE += $(wildcard src/*.c) SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) -CFLAGS += -Wno-error=cast-align +# TODO: suppress warning caused by host stack +CFLAGS += -Wno-error=cast-align -Wno-error=null-dereference # TinyUSB Host Stack source SRC_C += \ @@ -19,9 +20,7 @@ SRC_C += \ src/host/hub.c \ src/host/usbh.c \ src/host/usbh_control.c \ - src/portable/ehci/ehci.c \ src/portable/ohci/ohci.c \ - src/portable/nxp/transdimension/hcd_transdimension.c \ src/portable/nxp/lpc17_40/hcd_lpc17_40.c include ../../rules.mk diff --git a/examples/host/hid_controller/.only.MCU_MSP432E4 b/examples/host/hid_controller/.only.MCU_MSP432E4 new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/examples/host/hid_controller/.only.MCU_MSP432E4 diff --git a/examples/host/hid_controller/Makefile b/examples/host/hid_controller/Makefile index 6f59faeee..c58df562b 100644 --- a/examples/host/hid_controller/Makefile +++ b/examples/host/hid_controller/Makefile @@ -9,10 +9,11 @@ INC += \ EXAMPLE_SOURCE += \ src/hid_app.c \ src/main.c - + SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) -CFLAGS += -Wno-error=cast-align +# TODO: suppress warning caused by host stack +CFLAGS += -Wno-error=cast-align -Wno-error=null-dereference # TinyUSB Host Stack source SRC_C += \ @@ -22,9 +23,7 @@ SRC_C += \ src/host/hub.c \ src/host/usbh.c \ src/host/usbh_control.c \ - src/portable/ehci/ehci.c \ src/portable/ohci/ohci.c \ - src/portable/nxp/transdimension/hcd_transdimension.c \ src/portable/nxp/lpc17_40/hcd_lpc17_40.c include ../../rules.mk diff --git a/examples/host/hid_controller/src/hid_app.c b/examples/host/hid_controller/src/hid_app.c index c61ce70f3..582e01959 100644 --- a/examples/host/hid_controller/src/hid_app.c +++ b/examples/host/hid_controller/src/hid_app.c @@ -111,7 +111,11 @@ static inline bool is_sony_ds4(uint8_t dev_addr) uint16_t vid, pid; tuh_vid_pid_get(dev_addr, &vid, &pid); - return (vid == 0x054c && pid == 0x09cc); + return ( (vid == 0x054c && (pid == 0x09cc || pid == 0x05c4)) // Sony DualShock4 + || (vid == 0x0f0d && pid == 0x005e) // Hori FC4 + || (vid == 0x0f0d && pid == 0x00ee) // Hori PS4 Mini (PS4-099U) + || (vid == 0x1f4f && pid == 0x1002) // ASW GG xrd controller + ); } //--------------------------------------------------------------------+ @@ -134,6 +138,8 @@ void hid_app_task(void) // therefore report_desc = NULL, desc_len = 0 void tuh_hid_mount_cb(uint8_t dev_addr, uint8_t instance, uint8_t const* desc_report, uint16_t desc_len) { + (void)desc_report; + (void)desc_len; uint16_t vid, pid; tuh_vid_pid_get(dev_addr, &vid, &pid); diff --git a/examples/host/hid_controller/src/main.c b/examples/host/hid_controller/src/main.c index e13fa818a..b9b37a4d2 100644 --- a/examples/host/hid_controller/src/main.c +++ b/examples/host/hid_controller/src/main.c @@ -49,6 +49,7 @@ int main(void) board_init(); printf("TinyUSB Host HID Controller Example\r\n"); + printf("Note: Events only displayed for explictly supported controllers\r\n"); tusb_init(); |
