summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2022-05-10 21:56:47 +0700
committerhathach <[email protected]>2022-05-10 21:56:47 +0700
commit717a47412548923123141503749f721184222cf0 (patch)
tree0a1b731bb25068b49b951ef8475f0fd15fe2cc1b
parent993f7b6a2c0b325683ebb4f7dc5b0039d92c1eab (diff)
move pio-usb init to family_configure_pio_usb_example() to stay compatible
-rw-r--r--examples/dual/host_hid_to_device_cdc/CMakeLists.txt1
-rw-r--r--examples/host/bare_api/CMakeLists.txt5
-rw-r--r--examples/host/cdc_msc_hid/CMakeLists.txt3
-rw-r--r--examples/host/hid_controller/CMakeLists.txt5
-rw-r--r--hw/bsp/rp2040/family.cmake13
5 files changed, 21 insertions, 6 deletions
diff --git a/examples/dual/host_hid_to_device_cdc/CMakeLists.txt b/examples/dual/host_hid_to_device_cdc/CMakeLists.txt
index ff9f58c4c..bf3e042d1 100644
--- a/examples/dual/host_hid_to_device_cdc/CMakeLists.txt
+++ b/examples/dual/host_hid_to_device_cdc/CMakeLists.txt
@@ -27,3 +27,4 @@ target_include_directories(${PROJECT} PUBLIC
# in hw/bsp/FAMILY/family.cmake for details.
family_configure_device_example(${PROJECT})
family_configure_host_example(${PROJECT})
+family_configure_pio_usb_example(${PROJECT})
diff --git a/examples/host/bare_api/CMakeLists.txt b/examples/host/bare_api/CMakeLists.txt
index bff281a8c..e2e8d4fd5 100644
--- a/examples/host/bare_api/CMakeLists.txt
+++ b/examples/host/bare_api/CMakeLists.txt
@@ -24,4 +24,7 @@ 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}) \ No newline at end of file
+family_configure_host_example(${PROJECT})
+
+# For rp2040, un-comment to enable pico-pio-usb
+# family_configure_pio_usb_example(${PROJECT})
diff --git a/examples/host/cdc_msc_hid/CMakeLists.txt b/examples/host/cdc_msc_hid/CMakeLists.txt
index 95c07339e..ca0f8e48a 100644
--- a/examples/host/cdc_msc_hid/CMakeLists.txt
+++ b/examples/host/cdc_msc_hid/CMakeLists.txt
@@ -27,3 +27,6 @@ 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})
+
+# For rp2040, un-comment to enable pico-pio-usb
+# family_configure_pio_usb_example(${PROJECT})
diff --git a/examples/host/hid_controller/CMakeLists.txt b/examples/host/hid_controller/CMakeLists.txt
index aaf8bc34f..60678fc1c 100644
--- a/examples/host/hid_controller/CMakeLists.txt
+++ b/examples/host/hid_controller/CMakeLists.txt
@@ -25,4 +25,7 @@ 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}) \ No newline at end of file
+family_configure_host_example(${PROJECT})
+
+# For rp2040, un-comment to enable pico-pio-usb
+# family_configure_pio_usb_example(${PROJECT})
diff --git a/hw/bsp/rp2040/family.cmake b/hw/bsp/rp2040/family.cmake
index f51976d39..06ca74988 100644
--- a/hw/bsp/rp2040/family.cmake
+++ b/hw/bsp/rp2040/family.cmake
@@ -177,12 +177,19 @@ if (NOT TARGET _rp2040_family_inclusion_marker)
function(family_configure_device_example TARGET)
family_configure_target(${TARGET})
- target_link_libraries(${TARGET} PUBLIC pico_stdlib tinyusb_device tinyusb_pio_usb_base)
+ target_link_libraries(${TARGET} PUBLIC pico_stdlib tinyusb_device)
endfunction()
function(family_configure_host_example TARGET)
family_configure_target(${TARGET})
- target_link_libraries(${TARGET} PUBLIC pico_stdlib tinyusb_host tinyusb_pio_usb_base)
+ target_link_libraries(${TARGET} PUBLIC pico_stdlib tinyusb_host)
+ endfunction()
+
+ function(family_configure_pio_usb_example TARGET)
+ family_configure_target(${TARGET})
+ target_link_libraries(${TARGET} PUBLIC pico_stdlib tinyusb_pio_usb_base)
+ pico_generate_pio_header(tinyusb_common_base ${TOP}/lib/Pico-PIO-USB/src/usb_tx.pio)
+ pico_generate_pio_header(tinyusb_common_base ${TOP}/lib/Pico-PIO-USB/src/usb_rx.pio)
endfunction()
function(family_initialize_project PROJECT DIR)
@@ -190,8 +197,6 @@ if (NOT TARGET _rp2040_family_inclusion_marker)
_family_initialize_project(${PROJECT} ${DIR})
enable_language(C CXX ASM)
pico_sdk_init()
- pico_generate_pio_header(tinyusb_common_base ${TOP}/lib/Pico-PIO-USB/src/usb_tx.pio)
- pico_generate_pio_header(tinyusb_common_base ${TOP}/lib/Pico-PIO-USB/src/usb_rx.pio)
endfunction()
# This method must be called from the project scope to suppress known warnings in TinyUSB source files