Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation for PICO_BOARD=pico_w when cyw43_arch is missing #525

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion adc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
endif()
5 changes: 5 additions & 0 deletions adc/read_vsys/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions binary_info/blink_any/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
if (PICO_CYW43_SUPPORTED AND NOT TARGET pico_cyw43_arch)
return()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do some of these have a message (there is one without below too), and some not?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you don't see the same message repeatedly?

endif()
if (NOT PICO_CYW43_SUPPORTED)
message("Only building blink_any for non W boards as PICO_CYW43_SUPPORTED is not set")
endif()
Expand Down
5 changes: 5 additions & 0 deletions blink/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
)
Expand Down
28 changes: 20 additions & 8 deletions freertos/hello_freertos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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})
11 changes: 7 additions & 4 deletions freertos/hello_freertos/hello_freertos.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pico_w/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion pico_w/bt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pico_w/wifi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions pico_w/wifi/blink/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
if (PICO_CYW43_SUPPORTED AND NOT TARGET pico_cyw43_arch)
return()
endif()

add_executable(picow_blink
picow_blink.c
)
Expand Down
2 changes: 1 addition & 1 deletion pico_w/wifi/freertos/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)

Expand Down