diff --git a/.github/workflows/rpi_pico_w.yaml b/.github/workflows/rpi_pico.yaml similarity index 84% rename from .github/workflows/rpi_pico_w.yaml rename to .github/workflows/rpi_pico.yaml index 8b2375061..bf67c7965 100644 --- a/.github/workflows/rpi_pico_w.yaml +++ b/.github/workflows/rpi_pico.yaml @@ -11,7 +11,7 @@ # Contributors: # ZettaScale Zenoh Team, # -name: rpi_pico_w +name: rpi_pico on: push: @@ -21,12 +21,13 @@ on: jobs: build: - name: Build on ${{ matrix.os }} + name: Build on ${{ matrix.os }} for ${{ matrix.pico_board }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-latest] + pico_board: ["pico", "pico_w", "pico2", "pico2_w"] steps: - uses: actions/checkout@v4 - uses: jwlawson/actions-setup-cmake@v1.13 @@ -48,13 +49,15 @@ jobs: export FREERTOS_KERNEL_PATH=$HOME/work/FreeRTOS-Kernel/ mkdir -p $FREERTOS_KERNEL_PATH cd $FREERTOS_KERNEL_PATH - git clone https://github.com/FreeRTOS/FreeRTOS-Kernel.git --branch V11.1.0 . + git clone https://github.com/FreeRTOS/FreeRTOS-Kernel.git . git submodule update --init - name: Build examples run: | export PICO_SDK_PATH=$HOME/work/pico-sdk export FREERTOS_KERNEL_PATH=$HOME/work/FreeRTOS-Kernel/ - cd $HOME/work/zenoh-pico/zenoh-pico/examples/rpi_pico_w - cmake -Bbuild -DWIFI_SSID=wifi_network_ssid -DWIFI_PASSWORD=wifi_network_password + cd $HOME/work/zenoh-pico/zenoh-pico/examples/rpi_pico + cmake -Bbuild -DWIFI_SSID=wifi_network_ssid -DWIFI_PASSWORD=wifi_network_password -DPICO_BOARD="$PICO_BOARD" cmake --build ./build + env: + PICO_BOARD: ${{ matrix.pico_board}} diff --git a/CMakeLists.txt b/CMakeLists.txt index f79960cb0..2192475b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,7 +45,7 @@ include(GNUInstallDirs) option(BUILD_SHARED_LIBS "Build shared libraries if ON, otherwise build static libraries" ON) option(WITH_ZEPHYR "Build for Zephyr RTOS" OFF) option(WITH_FREERTOS_PLUS_TCP "Build for FreeRTOS RTOS and FreeRTOS-Plus-TCP network stack" OFF) -option(WITH_RPI_PICO_W "Build for Raspberry Pi Pico W" OFF) +option(WITH_RPI_PICO "Build for Raspberry Pi Pico" OFF) set(ZENOH_DEBUG 0 CACHE STRING "Use this to set the ZENOH_DEBUG variable") set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "") if(CMAKE_EXPORT_COMPILE_COMMANDS) @@ -186,7 +186,7 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Generic") pico_add_compile_definition(ZENOH_FREERTOS_PLUS_TCP) endif() elseif(CMAKE_SYSTEM_NAME MATCHES "PICO") # Raspberry Pi Pico Series - pico_add_compile_definition(ZENOH_RPI_PICO_W) + pico_add_compile_definition(ZENOH_RPI_PICO) set(CHECK_THREADS "OFF") else() message(FATAL_ERROR "zenoh-pico is not yet available on ${CMAKE_SYSTEM_NAME} platform") @@ -279,7 +279,7 @@ message(STATUS "Unicast batch max size: ${BATCH_UNICAST_SIZE}") message(STATUS "Multicast batch max size: ${BATCH_MULTICAST_SIZE}") message(STATUS "Build for Zephyr RTOS: ${WITH_ZEPHYR}") message(STATUS "Build for FreeRTOS-Plus-TCP: ${WITH_FREERTOS_PLUS_TCP}") -message(STATUS "Build for Raspberry Pi Pico W: ${WITH_RPI_PICO_W}") +message(STATUS "Build for Raspberry Pi Pico: ${WITH_RPI_PICO}") message(STATUS "Configuring for ${CMAKE_SYSTEM_NAME}") if(SKBUILD) @@ -341,9 +341,9 @@ if(WITH_ZEPHYR) elseif(WITH_FREERTOS_PLUS_TCP) file (GLOB Sources_Freertos_Plus_TCP "src/system/freertos_plus_tcp/*.c") list(APPEND Sources ${Sources_Freertos_Plus_TCP}) -elseif(WITH_RPI_PICO_W) - file (GLOB Sources_RPI_Pico_W "src/system/rpi_pico_w/*.c") - list(APPEND Sources ${Sources_RPI_Pico_W}) +elseif(WITH_RPI_PICO) + file (GLOB Sources_RPI_Pico "src/system/rpi_pico/*.c") + list(APPEND Sources ${Sources_RPI_Pico}) elseif(CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Darwin" OR CMAKE_SYSTEM_NAME MATCHES "BSD" OR POSIX_COMPATIBLE) file (GLOB Sources_Unix "src/system/unix/*.c" "src/system/unix/link/*.c") list(APPEND Sources ${Sources_Unix}) diff --git a/README.md b/README.md index 2fc8dc562..abc0fe0d0 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Currently, zenoh-pico provides support for the following (RT)OSs and protocols: | **OpenCR** | UDP (unicast and multicast), TCP | IPv4 | WiFi | | **Emscripten** | Websocket | IPv4, IPv6 | WiFi, Ethernet | | **FreeRTOS-Plus-TCP** | UDP (unicast), TCP | IPv4 | Ethernet | -|**Raspberry Pi Pico W**| UDP (unicast and multicast), TCP | IPv4 | WiFi, Serial | +| **Raspberry Pi Pico** | UDP (unicast and multicast), TCP | IPv4 | WiFi (for "W" version), Serial | Check the website [zenoh.io](http://zenoh.io) and the [roadmap](https://github.com/eclipse-zenoh/roadmap) for more detailed information. @@ -330,7 +330,8 @@ To build and upload the code into the board, run the following command: platformio run -t upload ``` -#### 2.2.6. Raspberry Pi Pico W +#### 2.2.6. Raspberry Pi Pico +Note: tested with `Raspberry Pi Pico W` and `Raspberry Pi Pico 2 W` boards Ensure your system has the necessary tools and libraries installed. Run the following commands: @@ -345,7 +346,7 @@ Set up the Raspberry Pi Pico SDK by cloning the repository: export PICO_SDK_PATH=$HOME/src/pico-sdk mkdir -p $PICO_SDK_PATH cd $PICO_SDK_PATH -git clone https://github.com/raspberrypi/pico-sdk.git --branch 2.1.0 . +git clone https://github.com/raspberrypi/pico-sdk.git . git submodule update --init ``` @@ -355,11 +356,12 @@ Clone the FreeRTOS Kernel repository for the project: export FREERTOS_KERNEL_PATH=$HOME/src/FreeRTOS-Kernel/ mkdir -p $FREERTOS_KERNEL_PATH cd $FREERTOS_KERNEL_PATH -git clone https://github.com/FreeRTOS/FreeRTOS-Kernel.git --branch V11.1.0 . +git clone https://github.com/FreeRTOS/FreeRTOS-Kernel.git . git submodule update --init ``` Setup and build the examples: + `PICO_BOARD` - Pico board type: pico, pico_w, pico2, pico2_w (default: pico_w) `WIFI_SSID` - Wi-Fi network SSID `WIFI_PASSWORD` - Wi-Fi password `ZENOH_CONFIG_MODE` - client or peer mode (default: client) @@ -367,12 +369,12 @@ Setup and build the examples: `ZENOH_CONFIG_LISTEN` - listen endpoint (only for peer mode, optional) ```bash -cd examples/rpi_pico_w -cmake -Bbuild -DWIFI_SSID=wifi_network_ssid -DWIFI_PASSWORD=wifi_network_password -DZENOH_CONFIG_MODE=[client|peer] -DZENOH_CONFIG_CONNECT=connect -DZENOH_CONFIG_LISTEN=listen +cd examples/rpi_pico +cmake -Bbuild -DPICO_BOARD="pico" -DWIFI_SSID=wifi_network_ssid -DWIFI_PASSWORD=wifi_network_password -DZENOH_CONFIG_MODE=[client|peer] -DZENOH_CONFIG_CONNECT=connect -DZENOH_CONFIG_LISTEN=listen cmake --build ./build ``` -To flash the Raspberry Pi Pico W board, connect it in bootloader mode (it will appear as a removable drive) and copy the generated .uf2 file onto it. +To flash the Raspberry Pi Pico board, connect it in bootloader mode (it will appear as a removable drive) and copy the generated .uf2 file onto it. ## 3. Running the Examples The simplest way to run some of the example is to get a Docker image of the **zenoh** router (see [http://zenoh.io/docs/getting-started/quick-test/](http://zenoh.io/docs/getting-started/quick-test/)) and then to run the examples on your machine. diff --git a/examples/rpi_pico_w/CMakeLists.txt b/examples/rpi_pico/CMakeLists.txt similarity index 73% rename from examples/rpi_pico_w/CMakeLists.txt rename to examples/rpi_pico/CMakeLists.txt index 6afd95dbc..12ce2e237 100644 --- a/examples/rpi_pico_w/CMakeLists.txt +++ b/examples/rpi_pico/CMakeLists.txt @@ -1,5 +1,12 @@ cmake_minimum_required(VERSION 3.13) +set(PICO_BOARD "pico_w" CACHE STRING "Raspberry Pi Pico board: pico, pico_w, pico2, pico2_w") + +set(WIFI_SUPPORT_ENABLED 0) +if(PICO_BOARD STREQUAL "pico_w" OR PICO_BOARD STREQUAL "pico2_w") + set(WIFI_SUPPORT_ENABLED 1) +endif() + # Set options set(WIFI_SSID "" CACHE STRING "WiFi SSID") set(WIFI_PASSWORD "" CACHE STRING "WiFi Password") @@ -8,6 +15,7 @@ set(ZENOH_CONFIG_MODE "client" CACHE STRING "ZENOH_CONFIG_MODE") set(ZENOH_CONFIG_CONNECT CACHE STRING "ZENOH_CONFIG_CONNECT") set(ZENOH_CONFIG_LISTEN CACHE STRING "ZENOH_CONFIG_LISTEN") +message(STATUS "PICO_BOARD: ${PICO_BOARD}") message(STATUS "WIFI_SSID: ${WIFI_SSID}") if(WIFI_PASSWORD STREQUAL "") message(STATUS "WIFI_PASSWORD is empty") @@ -27,7 +35,6 @@ configure_file( set(CMAKE_C_STANDARD 11) # Include Raspberry Pi Pico SDK -set(PICO_BOARD "pico_w") if(NOT DEFINED ENV{PICO_SDK_PATH}) message(FATAL_ERROR "PICO_SDK_PATH environment variable is not set. Please set it to the location of the Pico SDK.") endif() @@ -37,7 +44,13 @@ include($ENV{PICO_SDK_PATH}/external/pico_sdk_import.cmake) include(FreeRTOS_Kernel_import.cmake) # Configure project -project(zenohpico_rpi_pico_w_examples C CXX ASM) +project(zenohpico_rpi_pico_examples C CXX ASM) + +if(WIFI_SUPPORT_ENABLED) + set(WIFI_LIB pico_cyw43_arch_lwip_sys_freertos) +else() + set(WIFI_LIB "") +endif() add_compile_definitions(LWIP_TIMEVAL_PRIVATE=0) pico_sdk_init() @@ -46,15 +59,26 @@ pico_sdk_init() include(../../cmake/helpers.cmake) set_default_build_type(Release) +if (NOT WIFI_SUPPORT_ENABLED) + declare_cache_var(Z_FEATURE_LINK_TCP 0 STRING "TCP support") + declare_cache_var(Z_FEATURE_LINK_UDP_MULTICAST 0 STRING "UDP multicast support") + declare_cache_var(Z_FEATURE_LINK_UDP_UNICAST 0 STRING "UDP unicast support") + declare_cache_var(Z_FEATURE_SCOUTING_UDP 0 STRING "Scouting support") +endif() + +declare_cache_var(Z_FEATURE_LINK_SERIAL 1 STRING "Serial support") + set(BUILD_SHARED_LIBS OFF) -set(WITH_RPI_PICO_W ON) +set(WITH_RPI_PICO ON) + configure_include_project(ZENOHPICO zenohpico zenohpico::lib "../.." zenohpico "https://github.com/eclipse-zenoh/zenoh-pico" "") target_link_libraries(zenohpico_static hardware_uart pico_stdlib - pico_cyw43_arch_lwip_sys_freertos + pico_rand FreeRTOS-Kernel-Heap4 + ${WIFI_LIB} ) # Configure build @@ -71,8 +95,9 @@ target_include_directories(main PRIVATE ) target_link_libraries(main pico_stdlib - pico_cyw43_arch_lwip_sys_freertos + pico_rand FreeRTOS-Kernel-Heap4 + ${WIFI_LIB} ) function(add_example name) @@ -81,9 +106,10 @@ function(add_example name) main hardware_uart pico_stdlib - pico_cyw43_arch_lwip_sys_freertos + pico_rand FreeRTOS-Kernel-Heap4 zenohpico::lib + ${WIFI_LIB} ) target_include_directories(${name} PRIVATE ${CMAKE_CURRENT_LIST_DIR} diff --git a/examples/rpi_pico_w/FreeRTOS_Kernel_import.cmake b/examples/rpi_pico/FreeRTOS_Kernel_import.cmake similarity index 100% rename from examples/rpi_pico_w/FreeRTOS_Kernel_import.cmake rename to examples/rpi_pico/FreeRTOS_Kernel_import.cmake diff --git a/examples/rpi_pico_w/include/FreeRTOSConfig.h b/examples/rpi_pico/include/FreeRTOSConfig.h similarity index 100% rename from examples/rpi_pico_w/include/FreeRTOSConfig.h rename to examples/rpi_pico/include/FreeRTOSConfig.h diff --git a/examples/rpi_pico_w/include/config.h.in b/examples/rpi_pico/include/config.h.in similarity index 84% rename from examples/rpi_pico_w/include/config.h.in rename to examples/rpi_pico/include/config.h.in index 0ad957d41..37c150d13 100644 --- a/examples/rpi_pico_w/include/config.h.in +++ b/examples/rpi_pico/include/config.h.in @@ -1,6 +1,7 @@ #ifndef CONFIG_H #define CONFIG_H +#define WIFI_SUPPORT_ENABLED @WIFI_SUPPORT_ENABLED@ #define WIFI_SSID "@WIFI_SSID@" #define WIFI_PASSWORD "@WIFI_PASSWORD@" #define ZENOH_CONFIG_MODE "@ZENOH_CONFIG_MODE@" diff --git a/examples/rpi_pico_w/include/lwipopts.h b/examples/rpi_pico/include/lwipopts.h similarity index 100% rename from examples/rpi_pico_w/include/lwipopts.h rename to examples/rpi_pico/include/lwipopts.h diff --git a/examples/rpi_pico_w/main.c b/examples/rpi_pico/main.c similarity index 92% rename from examples/rpi_pico_w/main.c rename to examples/rpi_pico/main.c index 4bf328b83..8adef73dc 100644 --- a/examples/rpi_pico_w/main.c +++ b/examples/rpi_pico/main.c @@ -12,9 +12,15 @@ // ZettaScale Zenoh Team, // +#include + #include "FreeRTOS.h" #include "config.h" + +#if WIFI_SUPPORT_ENABLED #include "pico/cyw43_arch.h" +#endif + #include "pico/stdlib.h" #include "task.h" @@ -23,6 +29,7 @@ int app_main(); +#if WIFI_SUPPORT_ENABLED void print_ip_address() { struct netif *netif = &cyw43_state.netif[CYW43_ITF_STA]; if (netif_is_up(netif)) { @@ -33,12 +40,12 @@ void print_ip_address() { printf("Network interface is down.\n"); } } +#endif 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"); return; @@ -58,10 +65,15 @@ void main_task(void *params) { printf("Offline mode\n"); app_main(); } +#else + app_main(); +#endif printf("Terminate.\n"); +#if WIFI_SUPPORT_ENABLED cyw43_arch_deinit(); +#endif vTaskDelete(NULL); } diff --git a/examples/rpi_pico_w/z_get.c b/examples/rpi_pico/z_get.c similarity index 100% rename from examples/rpi_pico_w/z_get.c rename to examples/rpi_pico/z_get.c diff --git a/examples/rpi_pico_w/z_pub.c b/examples/rpi_pico/z_pub.c similarity index 100% rename from examples/rpi_pico_w/z_pub.c rename to examples/rpi_pico/z_pub.c diff --git a/examples/rpi_pico_w/z_pub_st.c b/examples/rpi_pico/z_pub_st.c similarity index 100% rename from examples/rpi_pico_w/z_pub_st.c rename to examples/rpi_pico/z_pub_st.c diff --git a/examples/rpi_pico_w/z_pub_thr.c b/examples/rpi_pico/z_pub_thr.c similarity index 100% rename from examples/rpi_pico_w/z_pub_thr.c rename to examples/rpi_pico/z_pub_thr.c diff --git a/examples/rpi_pico_w/z_pull.c b/examples/rpi_pico/z_pull.c similarity index 100% rename from examples/rpi_pico_w/z_pull.c rename to examples/rpi_pico/z_pull.c diff --git a/examples/rpi_pico_w/z_put.c b/examples/rpi_pico/z_put.c similarity index 100% rename from examples/rpi_pico_w/z_put.c rename to examples/rpi_pico/z_put.c diff --git a/examples/rpi_pico_w/z_queryable.c b/examples/rpi_pico/z_queryable.c similarity index 100% rename from examples/rpi_pico_w/z_queryable.c rename to examples/rpi_pico/z_queryable.c diff --git a/examples/rpi_pico_w/z_scout.c b/examples/rpi_pico/z_scout.c similarity index 100% rename from examples/rpi_pico_w/z_scout.c rename to examples/rpi_pico/z_scout.c diff --git a/examples/rpi_pico_w/z_sub.c b/examples/rpi_pico/z_sub.c similarity index 100% rename from examples/rpi_pico_w/z_sub.c rename to examples/rpi_pico/z_sub.c diff --git a/examples/rpi_pico_w/z_sub_st.c b/examples/rpi_pico/z_sub_st.c similarity index 100% rename from examples/rpi_pico_w/z_sub_st.c rename to examples/rpi_pico/z_sub_st.c diff --git a/examples/rpi_pico_w/z_sub_thr.c b/examples/rpi_pico/z_sub_thr.c similarity index 100% rename from examples/rpi_pico_w/z_sub_thr.c rename to examples/rpi_pico/z_sub_thr.c diff --git a/examples/rpi_pico_w/include/config.h b/examples/rpi_pico_w/include/config.h deleted file mode 100644 index c115cf39e..000000000 --- a/examples/rpi_pico_w/include/config.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef CONFIG_H -#define CONFIG_H - -#define WIFI_SSID "" -#define WIFI_PASSWORD "" -#define ZENOH_CONFIG_MODE "client" -#define ZENOH_CONFIG_CONNECT "serial/uart1_0#baudrate=38400" -#define ZENOH_CONFIG_LISTEN "" - -#endif // CONFIG_H diff --git a/extra_script.py b/extra_script.py index 1e519cb3e..6032a6b89 100644 --- a/extra_script.py +++ b/extra_script.py @@ -26,7 +26,7 @@ "-", "-", "-", - "-", + "-", "-", "-", "-", @@ -43,7 +43,7 @@ "-", "-", "-", - "-", + "-", "-", "-", "-", @@ -60,7 +60,7 @@ "-", "-", "-", - "-", + "-", "-", "-", "-", @@ -75,7 +75,7 @@ "-", "-", "-", - "-", + "-", "-", "-", "-", @@ -91,7 +91,7 @@ "-", "-", "-", - "-", + "-", "-", "-", "-", diff --git a/include/zenoh-pico/config.h b/include/zenoh-pico/config.h index 8228c2252..1578b1f50 100644 --- a/include/zenoh-pico/config.h +++ b/include/zenoh-pico/config.h @@ -34,7 +34,7 @@ #define Z_FEATURE_LINK_TCP 1 #define Z_FEATURE_LINK_BLUETOOTH 0 #define Z_FEATURE_LINK_WS 0 -#define Z_FEATURE_LINK_SERIAL 1 +#define Z_FEATURE_LINK_SERIAL 0 #define Z_FEATURE_SCOUTING_UDP 1 #define Z_FEATURE_LINK_UDP_MULTICAST 1 #define Z_FEATURE_LINK_UDP_UNICAST 1 diff --git a/include/zenoh-pico/system/platform/rpi_pico_w.h b/include/zenoh-pico/system/platform/rpi_pico.h similarity index 92% rename from include/zenoh-pico/system/platform/rpi_pico_w.h rename to include/zenoh-pico/system/platform/rpi_pico.h index 2610e2897..dd6b13dc9 100644 --- a/include/zenoh-pico/system/platform/rpi_pico_w.h +++ b/include/zenoh-pico/system/platform/rpi_pico.h @@ -12,8 +12,10 @@ // ZettaScale Zenoh Team, // -#ifndef ZENOH_PICO_SYSTEM_RPI_PICO_W_TYPES_H -#define ZENOH_PICO_SYSTEM_RPI_PICO_W_TYPES_H +#ifndef ZENOH_PICO_SYSTEM_RPI_PICO_TYPES_H +#define ZENOH_PICO_SYSTEM_RPI_PICO_TYPES_H + +#include #include "FreeRTOS.h" #include "event_groups.h" @@ -76,4 +78,4 @@ typedef struct { } #endif -#endif // ZENOH_PICO_SYSTEM_RPI_PICO_W_TYPES_H +#endif // ZENOH_PICO_SYSTEM_RPI_PICO_TYPES_H diff --git a/include/zenoh-pico/system/platform_common.h b/include/zenoh-pico/system/platform_common.h index d76f9c552..9ab0d4fc9 100644 --- a/include/zenoh-pico/system/platform_common.h +++ b/include/zenoh-pico/system/platform_common.h @@ -46,8 +46,8 @@ #include "zenoh-pico/system/platform/flipper.h" #elif defined(ZENOH_FREERTOS_PLUS_TCP) #include "zenoh-pico/system/platform/freertos_plus_tcp.h" -#elif defined(ZENOH_RPI_PICO_W) -#include "zenoh-pico/system/platform/rpi_pico_w.h" +#elif defined(ZENOH_RPI_PICO) +#include "zenoh-pico/system/platform/rpi_pico.h" #else #include "zenoh-pico/system/platform/void.h" #error "Unknown platform" diff --git a/src/session/scout.c b/src/session/scout.c index 7c35d1e21..b6e758542 100644 --- a/src/session/scout.c +++ b/src/session/scout.c @@ -18,6 +18,7 @@ #include "zenoh-pico/link/manager.h" #include "zenoh-pico/protocol/codec/transport.h" #include "zenoh-pico/protocol/core.h" +#include "zenoh-pico/system/platform.h" #include "zenoh-pico/transport/multicast.h" #include "zenoh-pico/utils/logging.h" diff --git a/src/system/espidf/network.c b/src/system/espidf/network.c index bc91f50c3..ca3b58c18 100644 --- a/src/system/espidf/network.c +++ b/src/system/espidf/network.c @@ -685,7 +685,7 @@ size_t _z_read_serial(const _z_sys_net_socket_t sock, uint8_t *ptr, size_t len) uint32_t c_crc = _z_crc32(ptr, payload_len); if (c_crc != crc) { - _Z_ERROR("CRC mismatch: %d != %d ", c_crc, crc); + _Z_ERROR("CRC mismatch: %ld != %ld ", c_crc, crc); ret = _Z_ERR_GENERIC; } } else { diff --git a/src/system/rpi_pico_w/network.c b/src/system/rpi_pico/network.c similarity index 99% rename from src/system/rpi_pico_w/network.c rename to src/system/rpi_pico/network.c index 174b59174..0fa21de0f 100644 --- a/src/system/rpi_pico_w/network.c +++ b/src/system/rpi_pico/network.c @@ -14,13 +14,6 @@ #include -#include "lwip/dns.h" -#include "lwip/ip4_addr.h" -#include "lwip/netdb.h" -#include "lwip/pbuf.h" -#include "lwip/sockets.h" -#include "lwip/udp.h" -#include "pico/cyw43_arch.h" #include "zenoh-pico/collections/string.h" #include "zenoh-pico/system/link/serial.h" #include "zenoh-pico/system/platform.h" @@ -31,6 +24,14 @@ #include "zenoh-pico/utils/result.h" #if Z_FEATURE_LINK_TCP == 1 +#include "lwip/dns.h" +#include "lwip/ip4_addr.h" +#include "lwip/netdb.h" +#include "lwip/pbuf.h" +#include "lwip/sockets.h" +#include "lwip/udp.h" +#include "pico/cyw43_arch.h" + /*------------------ TCP sockets ------------------*/ z_result_t _z_create_endpoint_tcp(_z_sys_net_endpoint_t *ep, const char *s_address, const char *s_port) { z_result_t ret = _Z_RES_OK; diff --git a/src/system/rpi_pico_w/system.c b/src/system/rpi_pico/system.c similarity index 99% rename from src/system/rpi_pico_w/system.c rename to src/system/rpi_pico/system.c index c1bc7d0b7..ee4b4b4fb 100644 --- a/src/system/rpi_pico_w/system.c +++ b/src/system/rpi_pico/system.c @@ -11,11 +11,13 @@ // Contributors: // ZettaScale Zenoh Team, +#include #include #include #include #include #include +#include #include "FreeRTOS.h" #include "zenoh-pico/config.h"