summaryrefslogtreecommitdiff
path: root/examples/host/hid_controller
diff options
context:
space:
mode:
authorMengsk <[email protected]>2022-12-29 12:14:52 +0100
committerMengsk <[email protected]>2022-12-29 12:14:52 +0100
commit8327090171246d0928195c49f4f15ce8b569a39b (patch)
tree40b3f6d218e06bff8ec485ec1b8bfa897ce8467c /examples/host/hid_controller
parentd584b07e2c8068a51c89421be2ddc116f4fc9d3e (diff)
parent549bee94add9d8f1c346bfa0fa6b25481db3f191 (diff)
Merge branch 'master' of https://github.com/hathach/tinyusb into stm32_fsdev
Diffstat (limited to 'examples/host/hid_controller')
-rw-r--r--examples/host/hid_controller/CMakeLists.txt13
-rw-r--r--examples/host/hid_controller/Makefile3
-rw-r--r--examples/host/hid_controller/src/hid_app.c1
-rw-r--r--examples/host/hid_controller/src/tusb_config.h6
4 files changed, 17 insertions, 6 deletions
diff --git a/examples/host/hid_controller/CMakeLists.txt b/examples/host/hid_controller/CMakeLists.txt
index 6153d399a..39adf9093 100644
--- a/examples/host/hid_controller/CMakeLists.txt
+++ b/examples/host/hid_controller/CMakeLists.txt
@@ -27,5 +27,14 @@ target_include_directories(${PROJECT} PUBLIC
# in hw/bsp/FAMILY/family.cmake for details.
family_configure_host_example(${PROJECT})
-# For rp2040, un-comment to enable pico-pio-usb
-# family_add_pico_pio_usb(${PROJECT})
+# For rp2040 enable pico-pio-usb
+if(FAMILY STREQUAL "rp2040")
+ family_add_pico_pio_usb(${PROJECT})
+
+ # due to warnings from Pico-PIO-USB
+ target_compile_options(${PROJECT} PUBLIC
+ -Wno-error=cast-qual
+ -Wno-error=sign-conversion
+ -Wno-error=conversion
+ )
+endif() \ No newline at end of file
diff --git a/examples/host/hid_controller/Makefile b/examples/host/hid_controller/Makefile
index 06dc56914..e7fbd741f 100644
--- a/examples/host/hid_controller/Makefile
+++ b/examples/host/hid_controller/Makefile
@@ -12,9 +12,6 @@ EXAMPLE_SOURCE += \
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
-# TODO: suppress warning caused by host stack
-CFLAGS += -Wno-error=cast-align -Wno-error=null-dereference
-
# TinyUSB Host Stack source
SRC_C += \
src/class/cdc/cdc_host.c \
diff --git a/examples/host/hid_controller/src/hid_app.c b/examples/host/hid_controller/src/hid_app.c
index 582e01959..75c91400e 100644
--- a/examples/host/hid_controller/src/hid_app.c
+++ b/examples/host/hid_controller/src/hid_app.c
@@ -162,7 +162,6 @@ void tuh_hid_mount_cb(uint8_t dev_addr, uint8_t instance, uint8_t const* desc_re
void tuh_hid_umount_cb(uint8_t dev_addr, uint8_t instance)
{
printf("HID device address = %d, instance = %d is unmounted\r\n", dev_addr, instance);
-
}
// check if different than 2
diff --git a/examples/host/hid_controller/src/tusb_config.h b/examples/host/hid_controller/src/tusb_config.h
index 475b9ca8f..e6d6f873d 100644
--- a/examples/host/hid_controller/src/tusb_config.h
+++ b/examples/host/hid_controller/src/tusb_config.h
@@ -34,6 +34,12 @@
// Board Specific Configuration
//--------------------------------------------------------------------+
+ #if CFG_TUSB_MCU == OPT_MCU_RP2040
+// change to 1 if using pico-pio-usb as host controller for raspberry rp2040
+#define CFG_TUH_RPI_PIO_USB 0
+#define BOARD_TUH_RHPORT CFG_TUH_RPI_PIO_USB
+#endif
+
// RHPort number used for host can be defined by board.mk, default to port 0
#ifndef BOARD_TUH_RHPORT
#define BOARD_TUH_RHPORT 0