diff --git a/adc/CMakeLists.txt b/adc/CMakeLists.txt index 71c423541..bb478da39 100644 --- a/adc/CMakeLists.txt +++ b/adc/CMakeLists.txt @@ -8,4 +8,4 @@ if (TARGET hardware_adc) add_subdirectory_exclude_platforms(read_vsys) else() message("Skipping ADC examples as hardware_adc is unavailable on this platform") -endif() \ No newline at end of file +endif() diff --git a/adc/read_vsys/CMakeLists.txt b/adc/read_vsys/CMakeLists.txt index 67535bd72..003368e20 100644 --- a/adc/read_vsys/CMakeLists.txt +++ b/adc/read_vsys/CMakeLists.txt @@ -1,3 +1,8 @@ +if (PICO_CYW43_SUPPORTED AND NOT TARGET pico_cyw43_arch) + message("Skipping read_vsys as Wi-Fi driver is not available") + return() +endif() + add_library(power_status_adc INTERFACE) target_sources(power_status_adc INTERFACE ${CMAKE_CURRENT_LIST_DIR}/power_status.c diff --git a/binary_info/blink_any/CMakeLists.txt b/binary_info/blink_any/CMakeLists.txt index de0401993..246db0918 100644 --- a/binary_info/blink_any/CMakeLists.txt +++ b/binary_info/blink_any/CMakeLists.txt @@ -1,3 +1,6 @@ +if (PICO_CYW43_SUPPORTED AND NOT TARGET pico_cyw43_arch) + return() +endif() if (NOT PICO_CYW43_SUPPORTED) message("Only building blink_any for non W boards as PICO_CYW43_SUPPORTED is not set") endif() diff --git a/blink/CMakeLists.txt b/blink/CMakeLists.txt index 6308572d4..dfdf716ed 100644 --- a/blink/CMakeLists.txt +++ b/blink/CMakeLists.txt @@ -1,3 +1,8 @@ +if (PICO_CYW43_SUPPORTED AND NOT TARGET pico_cyw43_arch) + message("Skipping blink examples as Wi-Fi driver is not available") + return() +endif() + add_executable(blink blink.c ) diff --git a/freertos/hello_freertos/CMakeLists.txt b/freertos/hello_freertos/CMakeLists.txt index 1da0ce773..4f3ffb6e4 100644 --- a/freertos/hello_freertos/CMakeLists.txt +++ b/freertos/hello_freertos/CMakeLists.txt @@ -11,10 +11,16 @@ target_link_libraries(${TARGET_NAME} PRIVATE pico_stdlib ) if(PICO_CYW43_SUPPORTED) - # For led support on pico_w - target_link_libraries(${TARGET_NAME} PRIVATE - pico_cyw43_arch_none - ) + if (TARGET pico_cyw43_arch) + # For led support on Wi-Fi boards + target_link_libraries(${TARGET_NAME} PRIVATE + pico_cyw43_arch_none + ) + else() + target_compile_definitions(${TARGET_NAME} PRIVATE + USE_LED=0 + ) + endif() endif() target_compile_definitions(${TARGET_NAME} PRIVATE configNUMBER_OF_CORES=1 @@ -34,9 +40,15 @@ target_link_libraries(${TARGET_NAME} PRIVATE pico_stdlib ) if(PICO_CYW43_SUPPORTED) - # For led support on pico_w - target_link_libraries(${TARGET_NAME} PRIVATE - pico_cyw43_arch_none - ) + if (TARGET pico_cyw43_arch) + # For led support on Wi-Fi boards + target_link_libraries(${TARGET_NAME} PRIVATE + pico_cyw43_arch_none + ) + else() + target_compile_definitions(${TARGET_NAME} PRIVATE + USE_LED=0 + ) + endif() endif() pico_add_extra_outputs(${TARGET_NAME}) diff --git a/freertos/hello_freertos/hello_freertos.c b/freertos/hello_freertos/hello_freertos.c index 77a3c8490..b5bf488a8 100755 --- a/freertos/hello_freertos/hello_freertos.c +++ b/freertos/hello_freertos/hello_freertos.c @@ -9,9 +9,16 @@ #include "pico/stdlib.h" #include "pico/multicore.h" +// Whether to flash the led +#ifndef USE_LED +#define USE_LED 1 +#endif + +#if USE_LED #ifdef CYW43_WL_GPIO_LED_PIN #include "pico/cyw43_arch.h" #endif +#endif #include "FreeRTOS.h" #include "task.h" @@ -21,10 +28,6 @@ #define RUN_FREE_RTOS_ON_CORE 0 #endif -// Whether to flash the led -#ifndef USE_LED -#define USE_LED 1 -#endif // Whether to busy wait in the led thread #ifndef LED_BUSY_WAIT diff --git a/pico_w/CMakeLists.txt b/pico_w/CMakeLists.txt index f66c02e95..8dd84e331 100644 --- a/pico_w/CMakeLists.txt +++ b/pico_w/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.12) if (PICO_CYW43_SUPPORTED) # set by PICO_BOARD=pico_w if (NOT TARGET pico_cyw43_arch) - message("Skipping Pico W examples as support is not available") + message("Skipping Wi-Fi examples as support is not available") else() if (DEFINED ENV{WIFI_SSID} AND (NOT WIFI_SSID)) @@ -20,7 +20,7 @@ if (PICO_CYW43_SUPPORTED) # set by PICO_BOARD=pico_w add_subdirectory(wifi) if (NOT TARGET pico_btstack_base) - message("Skipping Pico W Bluetooth examples as support is not available") + message("Skipping Bluetooth examples as support is not available") else() add_subdirectory(bt) endif() diff --git a/pico_w/bt/CMakeLists.txt b/pico_w/bt/CMakeLists.txt index e14345398..b4676ccc1 100644 --- a/pico_w/bt/CMakeLists.txt +++ b/pico_w/bt/CMakeLists.txt @@ -6,7 +6,7 @@ set(BTSTACK_3RD_PARTY_PATH ${BTSTACK_ROOT}/3rd-party) set(BT_EXAMPLE_COMMON_DIR "${CMAKE_CURRENT_LIST_DIR}") if (NOT PICO_EXTRAS_PATH) - message("Skipping some Pico W BTstack examples that require pico-extras") + message("Skipping some BTstack examples that require pico-extras") else() add_library(pico_btstack_audio_example INTERFACE) target_sources(pico_btstack_audio_example INTERFACE diff --git a/pico_w/wifi/CMakeLists.txt b/pico_w/wifi/CMakeLists.txt index 8b6e2b9b5..d64194e9e 100644 --- a/pico_w/wifi/CMakeLists.txt +++ b/pico_w/wifi/CMakeLists.txt @@ -6,9 +6,9 @@ add_subdirectory_exclude_platforms(wifi_scan) add_subdirectory_exclude_platforms(access_point) if ("${WIFI_SSID}" STREQUAL "") - message("Skipping some Pico W examples as WIFI_SSID is not defined") + message("Skipping some Wi-Fi examples as WIFI_SSID is not defined") elseif ("${WIFI_PASSWORD}" STREQUAL "") - message("Skipping some Pico W examples as WIFI_PASSWORD is not defined") + message("Skipping some Wi-Fi examples as WIFI_PASSWORD is not defined") else() add_subdirectory_exclude_platforms(freertos) add_subdirectory_exclude_platforms(httpd) diff --git a/pico_w/wifi/blink/CMakeLists.txt b/pico_w/wifi/blink/CMakeLists.txt index 2b1e6bfd3..2beb40c8e 100644 --- a/pico_w/wifi/blink/CMakeLists.txt +++ b/pico_w/wifi/blink/CMakeLists.txt @@ -1,3 +1,7 @@ +if (PICO_CYW43_SUPPORTED AND NOT TARGET pico_cyw43_arch) + return() +endif() + add_executable(picow_blink picow_blink.c ) diff --git a/pico_w/wifi/freertos/CMakeLists.txt b/pico_w/wifi/freertos/CMakeLists.txt index b4057602f..ab223e272 100644 --- a/pico_w/wifi/freertos/CMakeLists.txt +++ b/pico_w/wifi/freertos/CMakeLists.txt @@ -1,5 +1,5 @@ if (NOT FREERTOS_KERNEL_PATH AND NOT DEFINED ENV{FREERTOS_KERNEL_PATH}) - message("Skipping Pico W FreeRTOS examples as FREERTOS_KERNEL_PATH not defined") + message("Skipping Wi-Fi FreeRTOS examples as FREERTOS_KERNEL_PATH not defined") else() include(FreeRTOS_Kernel_import.cmake)