summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2022-05-26 23:54:20 +0700
committerGitHub <[email protected]>2022-05-26 23:54:20 +0700
commit7b1344fe69d0cd569f182e0f24c2427afd16a9ec (patch)
tree10791bc3befe30ebcc8f4db0b56ecef4e6fb56ad /examples
parentc1ae13b997825300235b3b77b6b87008a3db5177 (diff)
parent26c4d4b328ca93d0db5d8d7842a315cbde4d9f5a (diff)
Merge pull request #1467 from kilograham/rp2040_cleanup
Minor cleanup of RP2040 code post addition of Pico-PIO-USB
Diffstat (limited to 'examples')
-rw-r--r--examples/device/net_lwip_webserver/src/lwipopts.h2
-rw-r--r--examples/dual/CMakeLists.txt12
-rw-r--r--examples/dual/host_hid_to_device_cdc/CMakeLists.txt4
-rw-r--r--examples/host/bare_api/CMakeLists.txt2
-rw-r--r--examples/host/cdc_msc_hid/CMakeLists.txt2
-rw-r--r--examples/host/hid_controller/CMakeLists.txt2
6 files changed, 18 insertions, 6 deletions
diff --git a/examples/device/net_lwip_webserver/src/lwipopts.h b/examples/device/net_lwip_webserver/src/lwipopts.h
index a215017c7..639619f63 100644
--- a/examples/device/net_lwip_webserver/src/lwipopts.h
+++ b/examples/device/net_lwip_webserver/src/lwipopts.h
@@ -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
diff --git a/examples/dual/CMakeLists.txt b/examples/dual/CMakeLists.txt
new file mode 100644
index 000000000..d2f9a42f0
--- /dev/null
+++ b/examples/dual/CMakeLists.txt
@@ -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()
diff --git a/examples/dual/host_hid_to_device_cdc/CMakeLists.txt b/examples/dual/host_hid_to_device_cdc/CMakeLists.txt
index 24ebfdec3..ea4e087e3 100644
--- a/examples/dual/host_hid_to_device_cdc/CMakeLists.txt
+++ b/examples/dual/host_hid_to_device_cdc/CMakeLists.txt
@@ -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})
diff --git a/examples/host/bare_api/CMakeLists.txt b/examples/host/bare_api/CMakeLists.txt
index 607ef22eb..bc04b01a7 100644
--- a/examples/host/bare_api/CMakeLists.txt
+++ b/examples/host/bare_api/CMakeLists.txt
@@ -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}) \ No newline at end of file
diff --git a/examples/host/cdc_msc_hid/CMakeLists.txt b/examples/host/cdc_msc_hid/CMakeLists.txt
index 214e9f2e7..c4a4d8e63 100644
--- a/examples/host/cdc_msc_hid/CMakeLists.txt
+++ b/examples/host/cdc_msc_hid/CMakeLists.txt
@@ -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})
diff --git a/examples/host/hid_controller/CMakeLists.txt b/examples/host/hid_controller/CMakeLists.txt
index 6227e0790..6153d399a 100644
--- a/examples/host/hid_controller/CMakeLists.txt
+++ b/examples/host/hid_controller/CMakeLists.txt
@@ -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})