move pio-usb init to family_configure_pio_usb_example() to stay compatible

This commit is contained in:
hathach 2022-05-10 21:56:47 +07:00
parent 993f7b6a2c
commit 717a474125
5 changed files with 21 additions and 6 deletions

View File

@ -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})

View File

@ -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})
family_configure_host_example(${PROJECT})
# For rp2040, un-comment to enable pico-pio-usb
# family_configure_pio_usb_example(${PROJECT})

View File

@ -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})

View File

@ -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})
family_configure_host_example(${PROJECT})
# For rp2040, un-comment to enable pico-pio-usb
# family_configure_pio_usb_example(${PROJECT})

View File

@ -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