Minor cleanup of RP2040 code post addition of Pico-PIO_USB

* Removed some compiler warnings, and cleaned out unnecessary warning suppression from CMake suppress_tinyusb_warnings()
* Made explicit family_configure_dual_usb_example() for DUAL mode examples as family_configure_target() may not generally be called multiple times for the same target

* Renamed library pico_pio_usb to tinyusb_picio_pio_usb to be clearer and avoid conflict if someone already has a pico_pio_usb in their project
* Added family_add_pico_pio_usb() method for adding Pico-PIO_SUB support to an existing example
* Allowed tinyusb_pico_pio_usb to be added to regular apps using the Pico SDK
This commit is contained in:
graham sanderson
2022-05-20 17:25:30 -05:00
parent c2bcda86e2
commit 26c4d4b328
10 changed files with 106 additions and 80 deletions

View File

@@ -49,7 +49,9 @@
#define TCP_MSS (1500 /*mtu*/ - 20 /*iphdr*/ - 20 /*tcphhr*/)
#define TCP_SND_BUF (2 * TCP_MSS)
#ifndef TCP_WND
#define TCP_WND (TCP_MSS)
#endif
#define ETHARP_SUPPORT_STATIC_ENTRIES 1

View File

@@ -0,0 +1,12 @@
cmake_minimum_required(VERSION 3.5)
include(${CMAKE_CURRENT_SOURCE_DIR}/../../hw/bsp/family_support.cmake)
project(tinyusb_dual_examples)
family_initialize_project(tinyusb_dual_examples ${CMAKE_CURRENT_LIST_DIR})
if (FAMILY STREQUAL "rp2040" AND NOT TARGET tinyusb_pico_pio_usb)
message("Skipping dual host/device mode examples as Pico-PIO-USB is not available")
else()
# family_add_subdirectory will filter what to actually add based on selected FAMILY
family_add_subdirectory(host_hid_to_device_cdc)
endif()

View File

@@ -25,6 +25,4 @@ 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_device_example(${PROJECT})
family_configure_host_example(${PROJECT})
family_configure_pico_pio_usb_example(${PROJECT})
family_configure_dual_usb_example(${PROJECT})

View File

@@ -27,4 +27,4 @@ target_include_directories(${PROJECT} PUBLIC
family_configure_host_example(${PROJECT})
# For rp2040, un-comment to enable pico-pio-usb
# family_configure_pico_pio_usb_example(${PROJECT})
# family_add_pico_pio_usb(${PROJECT})

View File

@@ -29,4 +29,4 @@ target_include_directories(${PROJECT} PUBLIC
family_configure_host_example(${PROJECT})
# For rp2040, un-comment to enable pico-pio-usb
# family_configure_pico_pio_usb_example(${PROJECT})
# family_add_pico_pio_usb(${PROJECT})

View File

@@ -28,4 +28,4 @@ target_include_directories(${PROJECT} PUBLIC
family_configure_host_example(${PROJECT})
# For rp2040, un-comment to enable pico-pio-usb
# family_configure_pico_pio_usb_example(${PROJECT})
# family_add_pico_pio_usb(${PROJECT})