diff options
| author | hathach <[email protected]> | 2023-03-17 23:53:38 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2023-03-17 23:53:38 +0700 |
| commit | bdfcd50b1b601f85389a09cdaf183b2f27c1d470 (patch) | |
| tree | 0ed9312b74a74c875fd17b86353ac02559ac7081 /examples/host/bare_api | |
| parent | 73f22e31c7a31e9b974e27407b906bbc8cb05a7a (diff) | |
| parent | 65ee11ff630169c01a33860fbf8507d2d8f29a71 (diff) | |
Merge branch 'master' into portability
Diffstat (limited to 'examples/host/bare_api')
| -rw-r--r-- | examples/host/bare_api/CMakeLists.txt | 6 | ||||
| -rw-r--r-- | examples/host/bare_api/Makefile | 4 | ||||
| -rw-r--r-- | examples/host/bare_api/src/main.c | 2 | ||||
| -rw-r--r-- | examples/host/bare_api/src/tusb_config.h | 10 |
4 files changed, 13 insertions, 9 deletions
diff --git a/examples/host/bare_api/CMakeLists.txt b/examples/host/bare_api/CMakeLists.txt index bc04b01a7..616edd4ac 100644 --- a/examples/host/bare_api/CMakeLists.txt +++ b/examples/host/bare_api/CMakeLists.txt @@ -26,5 +26,7 @@ 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})
\ No newline at end of file +# 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/bare_api/Makefile b/examples/host/bare_api/Makefile index 13e14df53..058307c40 100644 --- a/examples/host/bare_api/Makefile +++ b/examples/host/bare_api/Makefile @@ -1,4 +1,3 @@ -include ../../../tools/top.mk include ../../make.mk INC += \ @@ -11,9 +10,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/bare_api/src/main.c b/examples/host/bare_api/src/main.c index 51cab2de0..bb7fa850e 100644 --- a/examples/host/bare_api/src/main.c +++ b/examples/host/bare_api/src/main.c @@ -1,4 +1,4 @@ -/* +/* * The MIT License (MIT) * * Copyright (c) 2019 Ha Thach (tinyusb.org) diff --git a/examples/host/bare_api/src/tusb_config.h b/examples/host/bare_api/src/tusb_config.h index ed0aaf7da..64be41a4e 100644 --- a/examples/host/bare_api/src/tusb_config.h +++ b/examples/host/bare_api/src/tusb_config.h @@ -1,4 +1,4 @@ -/* +/* * The MIT License (MIT) * * Copyright (c) 2019 Ha Thach (tinyusb.org) @@ -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 @@ -94,7 +100,7 @@ // max device support (excluding hub device) // 1 hub typically has 4 ports -#define CFG_TUH_DEVICE_MAX (CFG_TUH_HUB ? 4 : 1) +#define CFG_TUH_DEVICE_MAX (3*CFG_TUH_HUB + 1) // Max endpoint per device #define CFG_TUH_ENDPOINT_MAX 8 |
