Skip to content

Release.1.2.0 #469

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

Merged
merged 97 commits into from
Jun 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
20b9823
Delete some redundant CMake parts (#240)
lurch Mar 8, 2021
090c5cd
pio: Add 'pragma once' to generated header files (#237)
cmfcmf Mar 8, 2021
6f7dc67
pio: allow programs with 32 instructions (#236)
cmfcmf Mar 8, 2021
5867849
start development of 1.2.0
kilograham Mar 8, 2021
ea40696
fix config type
kilograham Mar 8, 2021
a2c7d75
build: fix mismatched config descriptions
kilograham Mar 8, 2021
3ad5e15
missing group rubbish:
kilograham Mar 9, 2021
26fd36f
Fixup incorrect doxygen for multicore_fifo_wready
lurch Mar 8, 2021
a257620
Add param-validation to spin_lock_instance
lurch Mar 8, 2021
6c1150f
Fix back-to-front description of IRQ priority in doxygen (#245)
Wren6991 Mar 14, 2021
336aae5
Fix ROSC typo (#259)
lurch Mar 15, 2021
cdf1a95
Typo (#251)
lurch Mar 15, 2021
9857456
Add gpio_get_out_level() accessor, and correct SIO GPIO_OUT struct ty…
Wren6991 Mar 22, 2021
3c0309c
Add pico_get_unique_board_id_string API (#281)
earlephilhower Mar 30, 2021
707555f
revert version number to correct develop settings
kilograham Apr 1, 2021
1089c1b
remove whitespace
kilograham Apr 1, 2021
fd16563
Merge pull request #299 from raspberrypi/back-merge-1.1.1
kilograham Apr 1, 2021
1620986
move PLL reset code from clocks driver to pll driver (#110)
majbthrd Apr 6, 2021
2e777d4
i2c: set hold time of SDA during transmit to an appropriate value (#273)
fivdi Apr 6, 2021
aabae62
Merge branch 'master' into develop
kilograham Apr 7, 2021
4fe995d
Update NULL GPIO function to 0x1f (#320)
lurch Apr 8, 2021
f69f513
i2c: set high and low times to values that conform to the i2c specifi…
fivdi Apr 9, 2021
814d2bd
Make flash_do_cmd public (#269)
tannewt Apr 9, 2021
344b961
Fix implementation config listing in structs/i2c.h (#324)
Wren6991 Apr 9, 2021
962da33
Clarify that cache is flushed, but that function is intended for low-…
Wren6991 Apr 9, 2021
5fdc663
Fix implementation config listing in structs/i2c.h (#325)
Wren6991 Apr 9, 2021
ec16d3f
Fix param-validation for PIO sideset encoding (#311)
lurch Apr 12, 2021
9c3538e
Remove MASTER_ON_HOLD bit from I2C status registers. Fix typos. (#326)
lurch Apr 12, 2021
127543a
Fixing arithmetic underflow in SPI I/O loops https://github.com/raspb…
michaelstoops Apr 13, 2021
c6d70d5
Source code licence clarification (#340)
lurch Apr 15, 2021
93d3cf4
Updated existing Pimoroni board headers to match latest style, and ad…
ZodiusInfuser Apr 18, 2021
b8dbbcf
SPI Definitions for SparkFun boards (#344)
Apr 18, 2021
b17fc76
Clarify multicore_fifo doxygen (#323)
lurch Apr 18, 2021
6c4d25b
correct adafruit flash size for itsybitsy and qt rp2040 (#348)
hathach Apr 21, 2021
5259693
Small typos (#366)
lurch May 1, 2021
4c83c10
make spi_init return baud rate set (#296)
kilograham May 1, 2021
d35d1b3
Fix path + typo in README.md (#347)
Exr0n May 2, 2021
c979ca5
disable core 0 SIO FIFO IRQ handler during core 1 launch in case some…
kilograham May 4, 2021
6796faf
add PICO_DIVIDER_DISABLE_INTERRUPTS flag which makes PICO_DIVIDER dis…
kilograham May 4, 2021
b7da70a
make all non hardware_ libraries foo add C preprocessor definition LI…
kilograham May 4, 2021
b6f812f
Change various (confusing to user) message to be DEBUG only (#365)
kilograham May 4, 2021
929ede7
add small delay to stdio_get_until to prevent starvation of USB IRQ h…
kilograham May 4, 2021
18c3985
Some cmake build improvements (#376)
kilograham May 4, 2021
8f3c3ff
i2c: improve communication with i2c devices in i2c_write_blocking
fivdi Apr 11, 2021
7fc75d8
Definitions for IC_TX_BUFFER_DEPTH inconsistent (fixes #335) (#381)
Wren6991 May 5, 2021
53f1915
Add hardware_exception for setting exception handlers at runtime (#380)
kilograham May 5, 2021
ec0dc7a
add __always_inline to trivial super low level inline functions (#379)
kilograham May 5, 2021
6d87da4
Rework lock_core / timers (#378)
kilograham May 5, 2021
8d4f4e1
remove spurious sys/select.h include (#377)
kilograham May 5, 2021
114dc5a
Fixup IRQ_PRIORITY #define values (#393)
lurch May 10, 2021
ecf66bf
Correct doxygen for mutex_try_enter (#392)
lurch May 10, 2021
9396b9c
Fix a bunch of doxygen typos (#391)
lurch May 10, 2021
e57b99a
Rework ordering of cmake, so that libraries in subdirectories can add…
kilograham May 11, 2021
36dda1c
Fix some hardware_library dependencies (#383)
kilograham May 11, 2021
508828f
allow setting exception handler to the same value, as this might happ…
kilograham May 11, 2021
6182a2a
make host pico_platform.h and binary_info.h CMakeLists.txt safe for i…
kilograham May 11, 2021
b05d863
Add basic CMSIS core headers (#384)
kilograham May 11, 2021
54c78bf
Fix the PICO_CONFIG default value for PICO_CMSIS_RENAME_EXCEPTIONS (#…
lurch May 12, 2021
c6c4eeb
add timeout_us/until to mutex/sem blocking methods (#402)
kilograham May 12, 2021
574fdee
Fixup divider save_restore for floating point too; improve tests (#405)
kilograham May 13, 2021
607b420
fix pico_promote_common_scope_vars (#397)
kilograham May 13, 2021
5384b6b
add comment about using clk_gpout0 enable bit (Fixes #413)
kahara May 16, 2021
a32d614
pioasm: prevent double inclusion for C SDK generated headers (#417)
rafaelmartins May 18, 2021
596d08e
Add missing cast to uint32_t in hw_divider_u32_quotient for host (#436)
jonathangjertsen May 23, 2021
060123d
Optional feature to get the max level that has ever been held by a qu…
jonathangjertsen May 24, 2021
b2832b3
Fix wrong format string in alarm_pool_dump_key (#437)
jonathangjertsen May 24, 2021
17ee1a8
Add support for Arduino Nano RP2040 Connect (#425)
facchinm May 24, 2021
777ccb8
Fix function-name misspelling (#443)
lurch May 24, 2021
94b8331
Update host multicore.h to match multicore.h in rp2_common (#439)
jonathangjertsen May 24, 2021
d79dd21
Implement `uart_write_blocking` and `uart_read_blocking` for host (#438)
jonathangjertsen May 24, 2021
80356a4
Define `__STRING` for other compilers than MSVC in the host platform.…
jonathangjertsen May 24, 2021
048fcde
Prevent warnings about some unused parameters in pico_stdio_usb when …
jonathangjertsen May 24, 2021
cc8b215
Define `void operator delete[](void *p, std::size_t n)` in new_delete…
jonathangjertsen May 24, 2021
b8dc054
queue: make data pointers const in queue_try_add and queue_add_blocki…
jonathangjertsen May 24, 2021
2eb76bb
- interp_ fixes (#428)
Reneg973 May 24, 2021
6994a38
-some typo fixes (#408)
Reneg973 May 24, 2021
a531123
Prevent the literal string DEBUG from being appended to some messages…
jonathangjertsen May 25, 2021
5ad072a
Add function to get the currently selected channel (#451)
jonathangjertsen May 27, 2021
e0872a3
Add missing board detection macros (#448)
2bndy5 May 27, 2021
1996a21
dma_channel_transfer_[from/to]_buffer_now: added const volatile to re…
geurtv May 27, 2021
c573775
Change the quick-start instructions to include installation of the (#92)
ewpa May 31, 2021
42cbdcb
added spi_get_baudrate() + some consistency changes (#395)
Reneg973 Jun 1, 2021
d026118
Allow lengthening xosc startup delay with a compile option (#457)
dhalbert Jun 1, 2021
30041d8
Add hardware_gpio accessors for Schmitt, slew rate, drive strength (f…
Wren6991 Jun 1, 2021
895bad7
Add some spin lock related doxygen
kilograham May 25, 2021
27c1a89
review fixes
kilograham May 27, 2021
66c54d8
fix PICO_CONFIG entry
kilograham May 27, 2021
496ff66
Make PICO_CONFIG descriptions unique
kilograham May 31, 2021
561502c
Move to Tinyusb 0.10.0 (still with RP patches) (#462)
kilograham Jun 2, 2021
b3e1d2d
Add usb device dpram to svd file. Fixes #351 (#465)
liamfraser Jun 2, 2021
91e9327
Add PICO_PANIC_FUNCTION define to allow replacement of the default pa…
kilograham Jun 2, 2021
5afa363
Small API additions and minor fixes (#406)
kilograham Jun 2, 2021
eeb6b50
fix qtpy rp2040 uart rx rev B (#466)
hathach Jun 2, 2021
4b0dea4
Move to upstream tinyusb (#467)
kilograham Jun 2, 2021
8d7bdd2
change version to 1.2.0 proper
kilograham Jun 2, 2021
bba0420
Add gpio_set_irqover to match inover/outover/oeover (fixes #265) (#470)
Wren6991 Jun 3, 2021
c44e62d
Added board definition (#471)
ZodiusInfuser Jun 3, 2021
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
3 changes: 1 addition & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[submodule "tinyusb"]
path = lib/tinyusb
url = https://github.com/raspberrypi/tinyusb.git
branch = pico
url = https://github.com/hathach/tinyusb.git
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
cmake_minimum_required(VERSION 3.13)

# Note: this CMakeLists.txt can be used as a top-level CMakeLists.txt for the SDK itself. For all other uses
# it is included as a subdirectory via the pico_sdk_init() method provided by pico_sdk_init.cmake
if (NOT TARGET _pico_sdk_inclusion_marker)
add_library(_pico_sdk_inclusion_marker INTERFACE)
# This is a no-op unless we are the top-level CMakeLists.txt
include(pico_sdk_init.cmake)

project(pico_sdk C CXX ASM)
Expand All @@ -24,6 +28,7 @@ if (NOT TARGET _pico_sdk_inclusion_marker)

# allow customization
add_sub_list_dirs(PICO_SDK_PRE_LIST_DIRS)
add_sub_list_files(PICO_SDK_PRE_LIST_FILES)

add_subdirectory(tools)
add_subdirectory(src)
Expand All @@ -32,6 +37,7 @@ if (NOT TARGET _pico_sdk_inclusion_marker)

# allow customization
add_sub_list_dirs(PICO_SDK_POST_LIST_DIRS)
add_sub_list_files(PICO_SDK_POST_LIST_FILES)

if (PICO_SDK_TOP_LEVEL_PROJECT AND NOT DEFINED PICO_SDK_TESTS_ENABLED)
set(PICO_SDK_TESTS_ENABLED 1)
Expand All @@ -44,5 +50,9 @@ if (NOT TARGET _pico_sdk_inclusion_marker)

# add docs at the end, as we gather documentation dirs as we go
add_subdirectory(docs)

if (NOT PICO_SDK_TOP_LEVEL_PROJECT)
pico_promote_common_scope_vars()
endif()
endif()

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The Raspberry Pi Pico SDK (henceforth the SDK) provides the headers, libraries a
necessary to write programs for the RP2040-based devices such as the Raspberry Pi Pico
in C, C++ or assembly language.

The SDK is designed to provide an API and programming environment that is familiar both to non-embedded C developers and embedded C developers alike.
The SDK is designed to provide an API and programming environment that is familiar both to non-embedded C developers and embedded C developers alike.
A single program runs on the device at a time and starts with a conventional `main()` method. Standard C/C++ libraries are supported along with
C level libraries/APIs for accessing all of the RP2040's hardware include PIO (Programmable IO).

Expand Down Expand Up @@ -38,7 +38,7 @@ instructions for other platforms, and just in general, we recommend you see [Ras

1. Install CMake (at least version 3.13), and GCC cross compiler
```
sudo apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi
sudo apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib
```
1. Set up your project to point to use the Raspberry Pi Pico SDK

Expand Down
2 changes: 1 addition & 1 deletion cmake/pico_pre_load_toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ if (DEFINED PICO_COMPILER)
select one from \"cmake/toolchains\" folder.")
endif ()
endif ()
message("PICO compiler is ${PICO_COMPILER}")
endif ()

message("PICO compiler is ${PICO_COMPILER}")
unset(PICO_COMPILER CACHE)

2 changes: 1 addition & 1 deletion cmake/preload/toolchains/pico_arm_gcc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if (NOT PICO_GCC_TRIPLE)
message("PICO_GCC_TRIPLE set from environment: $ENV{PICO_GCC_TRIPLE}")
else()
set(PICO_GCC_TRIPLE arm-none-eabi)
message("PICO_GCC_TRIPLE defaulted to arm-none-eabi")
#pico_message_debug("PICO_GCC_TRIPLE defaulted to arm-none-eabi")
endif()
endif()

Expand Down
2 changes: 1 addition & 1 deletion docs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
find_package(Doxygen)
find_package(Doxygen QUIET)
if (PICO_SDK_TOP_LEVEL_PROJECT AND ${DOXYGEN_FOUND})
set(PICO_BUILD_DOCS_DEFAULT 1)
endif()
Expand Down
2 changes: 1 addition & 1 deletion docs/examples.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Examples Index {#examples_page}

This page links to the various example code fragments in this documentation. For more complete examples, please see the pico_examples repository, which contains complete buildable projects.
This page links to the various example code fragments in this documentation. For more complete examples, please see the [pico-examples](https://github.com/raspberrypi/pico-examples) repository, which contains complete buildable projects.

- [RTC example](@ref rtc_example)
- [UART example](@ref uart_example)
Expand Down
1 change: 1 addition & 0 deletions docs/index.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* \defgroup hardware_clocks hardware_clocks
* \defgroup hardware_divider hardware_divider
* \defgroup hardware_dma hardware_dma
* \defgroup hardware_exception hardware_exception
* \defgroup hardware_flash hardware_flash
* \defgroup hardware_gpio hardware_gpio
* \defgroup hardware_i2c hardware_i2c
Expand Down
3 changes: 1 addition & 2 deletions docs/mainpage.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ The SDK builds an executable which is bare metal, i.e. it includes the entirety
## Examples


This SDK contains a number of example code fragments. An index of these examples can be found [here](@ref examples_page)

This SDK documentation contains a number of example code fragments. An index of these examples can be found [here](@ref examples_page). These examples, and any other source code included in this documentation, is Copyright © 2020 Raspberry Pi (Trading) Ltd. and licensed under the [3-Clause BSD](https://opensource.org/licenses/BSD-3-Clause) license.


2 changes: 1 addition & 1 deletion lib/tinyusb
Submodule tinyusb updated 819 files
120 changes: 80 additions & 40 deletions pico_sdk_init.cmake
Original file line number Diff line number Diff line change
@@ -1,54 +1,94 @@
# Initialize the Raspberry Pi Pico SDK
# Pre-initialize the Raspberry Pi Pico SDK, setting up the platform and toolchain and some CMake utility functions
# This file must be included prior to the project() call

if (_PICO_SDK_INIT)
return()
endif ()
set(_PICO_SDK_INIT 1)
# Note: this file is perhaps named badly, as it provides a method pico_sdk_init which
# the enclosing project calls LATER to actually "initialize" the SDK (by including the CMakeLists.txt from this
# same directory)

function(pico_is_top_level_project VAR)
string(TOLOWER ${CMAKE_CURRENT_LIST_DIR} __list_dir)
string(TOLOWER ${CMAKE_SOURCE_DIR} __source_dir)
if (__source_dir STREQUAL __list_dir)
set(${VAR} 1 PARENT_SCOPE)
else()
set(${VAR} 0 PARENT_SCOPE)
endif()
endfunction()
if (NOT TARGET _pico_sdk_pre_init_marker)
add_library(_pico_sdk_pre_init_marker INTERFACE)

if (NOT PICO_SDK_PATH)
set(PICO_SDK_PATH ${CMAKE_CURRENT_LIST_DIR})
endif ()
function(pico_is_top_level_project VAR)
string(TOLOWER ${CMAKE_CURRENT_LIST_DIR} __list_dir)
string(TOLOWER ${CMAKE_SOURCE_DIR} __source_dir)
if (__source_dir STREQUAL __list_dir)
set(${VAR} 1 PARENT_SCOPE)
else()
set(${VAR} 0 PARENT_SCOPE)
endif()
endfunction()

get_filename_component(PICO_SDK_PATH "${PICO_SDK_PATH}" REALPATH BASE_DIR "${CMAKE_BINARY_DIR}")
function(pico_message_debug MESSAGE)
# The log-level system was added in CMake 3.15.
if(${CMAKE_VERSION} VERSION_LESS "3.15.0")
message(${MESSAGE})
else()
message(DEBUG ${MESSAGE})
endif()
endfunction()

set(PICO_SDK_PATH ${CMAKE_CURRENT_LIST_DIR} CACHE PATH "Path to the Raspberry Pi Pico SDK" FORCE)
if (NOT PICO_SDK_PATH)
set(PICO_SDK_PATH ${CMAKE_CURRENT_LIST_DIR})
endif ()

list(APPEND CMAKE_MODULE_PATH ${PICO_SDK_PATH}/cmake)
get_filename_component(PICO_SDK_PATH "${PICO_SDK_PATH}" REALPATH BASE_DIR "${CMAKE_BINARY_DIR}")

include(${CMAKE_CURRENT_LIST_DIR}/pico_sdk_version.cmake)
include(pico_utils)
set(PICO_SDK_PATH ${CMAKE_CURRENT_LIST_DIR} CACHE PATH "Path to the Raspberry Pi Pico SDK" FORCE)

message("PICO_SDK_PATH is ${CMAKE_CURRENT_LIST_DIR}")
list(APPEND CMAKE_MODULE_PATH ${PICO_SDK_PATH}/cmake)

include(pico_pre_load_platform)
include(${CMAKE_CURRENT_LIST_DIR}/pico_sdk_version.cmake)
include(pico_utils)

# todo perhaps this should be included by the platform instead?
# We want to configure correct toolchain prior to project load
include(pico_pre_load_toolchain)
message("PICO_SDK_PATH is ${CMAKE_CURRENT_LIST_DIR}")

macro(pico_sdk_init)
if (NOT CMAKE_PROJECT_NAME)
message(WARNING "pico_sdk_init() should be called after the project is created (and languages added)")
endif()
add_subdirectory(${PICO_SDK_PATH} pico-sdk)
endmacro()
include(pico_pre_load_platform)

macro(add_sub_list_dirs var)
foreach(LIST_DIR IN LISTS ${var})
get_filename_component(SHORT_NAME "${LIST_DIR}" NAME)
message("Including custom CMakeLists.txt ${SHORT_NAME}")
add_subdirectory(${LIST_DIR} ${SHORT_NAME})
endforeach()
endmacro()
# We want to configure correct toolchain prior to project load
# todo perhaps this should be included by the platform instead?
include(pico_pre_load_toolchain)

macro(pico_sdk_init)
if (NOT CMAKE_PROJECT_NAME)
message(WARNING "pico_sdk_init() should be called after the project is created (and languages added)")
endif()
add_subdirectory(${PICO_SDK_PATH} pico-sdk)
pico_is_top_level_project(ISTOP)
endmacro()

macro(add_sub_list_dirs var)
foreach(LIST_DIR IN LISTS ${var})
get_filename_component(SHORT_NAME "${LIST_DIR}" NAME)
pico_message_debug("Including custom CMakeLists.txt ${SHORT_NAME}")
add_subdirectory(${LIST_DIR} ${SHORT_NAME})
endforeach()
endmacro()

macro(add_sub_list_files var)
foreach(LIST_FILE IN LISTS ${var})
pico_message_debug("Including custom CMake file ${LIST_FILE}")
include(${LIST_FILE})
endforeach()
endmacro()

macro(pico_register_common_scope_var NAME)
if (NOT ${NAME} IN_LIST PICO_PROMOTE_COMMON_SCOPE_VARS)
list(APPEND PICO_PROMOTE_COMMON_SCOPE_VARS ${NAME})
endif()
endmacro()

set(PICO_PROMOTE_COMMON_SCOPE_VARS
PICO_INCLUDE_DIRS
PICO_SDK_POST_LIST_DIRS
PICO_SDK_POST_LIST_FILES
PICO_CONFIG_HEADER_FILES
PICO_RP2040_CONFIG_HEADER_FILES
)

macro(pico_promote_common_scope_vars)
set(PICO_PROMOTE_COMMON_SCOPE_VARS ${PICO_PROMOTE_COMMON_SCOPE_VARS} PARENT_SCOPE)
foreach(VAR IN LISTS PICO_PROMOTE_COMMON_SCOPE_VARS)
SET(${VAR} ${${VAR}} PARENT_SCOPE)
endforeach()
endmacro()
endif()
5 changes: 2 additions & 3 deletions pico_sdk_version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
set(PICO_SDK_VERSION_MAJOR 1)
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_MINOR, SDK minor version number, type=int, group=pico_base
# PICO_CONFIG: PICO_SDK_VERSION_MINOR, SDK minor version number, type=int, group=pico_base
set(PICO_SDK_VERSION_MINOR 1)
set(PICO_SDK_VERSION_MINOR 2)
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_REVISION, SDK version revision, type=int, group=pico_base
# PICO_CONFIG: PICO_SDK_VERSION_REVISION, SDK version revision, type=int, group=pico_base
set(PICO_SDK_VERSION_REVISION 2)
set(PICO_SDK_VERSION_REVISION 0)
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_PRE_RELEASE_ID, optional SDK pre-release version identifier, type=string, group=pico_base
# PICO_CONFIG: PICO_SDK_VERSION_PRE_RELEASE_ID, optional SDK pre-release version identifier, type=string, group=pico_base
#set(PICO_SDK_VERSION_PRE_RELEASE_ID develop)

# PICO_BUILD_DEFINE: PICO_SDK_VERSION_STRING, SDK version, type=string, group=pico_base
# PICO_CONFIG: PICO_SDK_VERSION_STRING, SDK version, type=string, group=pico_base
Expand Down
36 changes: 34 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,28 @@ if (NOT EXISTS "${PICO_PLATFORM_CMAKE_FILE}")
Either specify a valid PICO_PLATFORM (or PICO_PLATFORM_CMAKE_FILE).")
endif ()

# Initialize board related build/compile settings
include(${CMAKE_CURRENT_LIST_DIR}/board_setup.cmake)

# todo add option to disable skip flag
# call add_subdirectory(subdir) unless SKIP_SUBDIR evaluates to true
function(pico_add_subdirectory subdir)
# todo add option to disable skip flag
string(TOUPPER ${subdir} subdir_upper)
set(replace_flag SKIP_${subdir_upper})
if (NOT ${replace_flag})
add_subdirectory(${subdir})
else ()
message("Not including ${subdir} because ${replace_flag} defined.")
endif ()
pico_promote_common_scope_vars()
endfunction()

# add a link option to wrap the given function name; i.e. -Wl:wrap=FUNCNAME for gcc
function(pico_wrap_function TARGET FUNCNAME)
target_link_options(${TARGET} INTERFACE "LINKER:--wrap=${FUNCNAME}")
endfunction()

# add map file generation for the given target
function(pico_add_map_output TARGET)
get_target_property(target_type ${TARGET} TYPE)
if ("EXECUTABLE" STREQUAL "${target_type}")
Expand All @@ -37,11 +42,23 @@ function(pico_add_map_output TARGET)
endif ()
endfunction()

# create a hardware_NAME_headers target (see pico_pico_simple_hardware_headers_target)
# create a hardware_NAME target (see pico_pico_simple_hardware_target)
macro(pico_simple_hardware_target NAME)
pico_simple_hardware_headers_target(${NAME})
pico_simple_hardware_impl_target(${NAME})
endmacro()

# create an INTERFACE library named target, and define LIB_TARGET=1 (upper case) as a compile option
function(pico_add_impl_library target)
add_library(${target} INTERFACE)
string(TOUPPER ${target} TARGET_UPPER)
target_compile_definitions(${target} INTERFACE LIB_${TARGET_UPPER}=1)
endfunction()

# create an INTERFACE library named hardware_NAME_headers INTERFACE library if it doesn't already exist,
# and add include/ relative to the calling directory to the includes.
# and hardware_structs and hardware_claim as dependencies of the library
macro(pico_simple_hardware_headers_target NAME)
if (NOT TARGET hardware_${NAME}_headers)
add_library(hardware_${NAME}_headers INTERFACE)
Expand All @@ -54,8 +71,15 @@ macro(pico_simple_hardware_headers_target NAME)
endif()
endmacro()

# create an INTERFACE library named hardware_NAME if it doesn't exist, along with a hardware_NAME_headers
# INTERFACE library that it depends on. The hardware_NAME_headers library add include/ relative to
# and pico_base_headers, and harddware_structs as a dependency of the library
macro(pico_simple_hardware_headers_only_target NAME)
if (NOT TARGET hardware_${NAME})
# Choosing not to add LIB_HARDWARE_ defines to avoid command line bloat pending a need (they aren't
# super interesting except to determine functionality as they are mostly passive accessors, however
# they could be useful to determine if the header is available.
# pico_add_sdk_impl_library(hardware_${NAME})
add_library(hardware_${NAME} INTERFACE)

target_include_directories(hardware_${NAME} INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include)
Expand All @@ -66,8 +90,14 @@ macro(pico_simple_hardware_headers_only_target NAME)
endif()
endmacro()

# create an INTERFACE library named hardware_NAME if it doesn't exist, dependent on a pre-existing hardware_NAME_headers
# INTERFACE library and pico_platform. The file NAME.c relative to the caller is added to the C sources for the hardware_NAME
macro(pico_simple_hardware_impl_target NAME)
if (NOT TARGET hardware_${NAME})
# Choosing not to add LIB_HARDWARE_ defines to avoid command line bloat pending a need (they aren't
# super interesting except to determine functionality as they are mostly passive accessors, however
# they could be useful to determine if the header is available.
# pico_add_sdk_impl_library(hardware_${NAME})
add_library(hardware_${NAME} INTERFACE)

target_sources(hardware_${NAME} INTERFACE
Expand All @@ -86,4 +116,6 @@ function(pico_add_doxygen_exclude SOURCE_DIR)
set(PICO_DOXYGEN_EXCLUDE_PATHS "${PICO_DOXYGEN_EXCLUDE_PATHS} ${SOURCE_DIR}" CACHE INTERNAL "")
endfunction()

include(${PICO_PLATFORM_CMAKE_FILE})
include(${PICO_PLATFORM_CMAKE_FILE})

pico_promote_common_scope_vars()
5 changes: 5 additions & 0 deletions src/boards/include/boards/adafruit_feather_rp2040.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
// For board detection
#define ADAFRUIT_FEATHER_RP2040

// On some samples, the xosc can take longer to stabilize than is usual
#ifndef PICO_XOSC_STARTUP_DELAY_MULTIPLIER
#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64
#endif

//------------- UART -------------//
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 0
Expand Down
7 changes: 6 additions & 1 deletion src/boards/include/boards/adafruit_itsybitsy_rp2040.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
// For board detection
#define ADAFRUIT_ITSYBITSY_RP2040

// On some samples, the xosc can take longer to stabilize than is usual
#ifndef PICO_XOSC_STARTUP_DELAY_MULTIPLIER
#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64
#endif

//------------- UART -------------//
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 0
Expand Down Expand Up @@ -80,7 +85,7 @@
#endif

#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (4 * 1024 * 1024)
#define PICO_FLASH_SIZE_BYTES (8 * 1024 * 1024)
#endif

// All boards have B1 RP2040
Expand Down
Loading