From d5789b56d8dc3767644e48cdc5259428bb635ad3 Mon Sep 17 00:00:00 2001 From: Alexander Bushnev Date: Thu, 5 Dec 2024 16:16:01 +0100 Subject: [PATCH] Fix USB stdout --- examples/rpi_pico/CMakeLists.txt | 7 ++++++- examples/rpi_pico/include/{ => tusb}/tusb_config.h | 0 examples/rpi_pico/main.c | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) rename examples/rpi_pico/include/{ => tusb}/tusb_config.h (100%) diff --git a/examples/rpi_pico/CMakeLists.txt b/examples/rpi_pico/CMakeLists.txt index 483eb8d23..7ae847c02 100644 --- a/examples/rpi_pico/CMakeLists.txt +++ b/examples/rpi_pico/CMakeLists.txt @@ -60,8 +60,12 @@ if(ZENOH_USB_UART) tinyusb_device tinyusb_board ) + set(USB_INCLUDE + ${CMAKE_CURRENT_LIST_DIR}/include/tusb + ) else() set(USB_LIBS "") + set(USB_INCLUDE "") endif() add_compile_definitions(LWIP_TIMEVAL_PRIVATE=0) @@ -103,6 +107,7 @@ target_link_libraries(zenohpico_static target_include_directories(zenohpico_static PRIVATE ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_CURRENT_LIST_DIR}/include + ${USB_INCLUDE} ) add_library(main STATIC main.c) @@ -116,7 +121,6 @@ target_link_libraries(main pico_rand FreeRTOS-Kernel-Heap4 ${WIFI_LIB} - ${USB_LIBS} ) function(add_example name) @@ -134,6 +138,7 @@ function(add_example name) target_include_directories(${name} PRIVATE ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_CURRENT_LIST_DIR}/include + ${USB_INCLUDE} ) if(ZENOH_USB_UART) pico_enable_stdio_uart(${name} 1) diff --git a/examples/rpi_pico/include/tusb_config.h b/examples/rpi_pico/include/tusb/tusb_config.h similarity index 100% rename from examples/rpi_pico/include/tusb_config.h rename to examples/rpi_pico/include/tusb/tusb_config.h diff --git a/examples/rpi_pico/main.c b/examples/rpi_pico/main.c index 8adef73dc..253b81541 100644 --- a/examples/rpi_pico/main.c +++ b/examples/rpi_pico/main.c @@ -44,7 +44,7 @@ void print_ip_address() { void main_task(void *params) { (void)params; - + vTaskDelay(pdMS_TO_TICKS(1000)); #if WIFI_SUPPORT_ENABLED if (cyw43_arch_init()) { printf("Failed to initialise\n");