Standardise references to Raspberry Pi Pico SDK (#21)

This commit is contained in:
Andrew Scheller 2021-01-30 17:16:32 +00:00 committed by GitHub
parent 3f8bff094d
commit 13f89f6282
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 13 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.12) cmake_minimum_required(VERSION 3.12)
# Pull in PICO SDK (must be before project) # Pull in SDK (must be before project)
include(pico_sdk_import.cmake) include(pico_sdk_import.cmake)
project(pico_examples C CXX ASM) project(pico_examples C CXX ASM)

View File

@ -1,4 +1,4 @@
# PICO SDK Examples # Raspberry Pi Pico SDK Examples
## Getting started ## Getting started
@ -7,9 +7,9 @@ on getting up and running.
### First Examples ### First Examples
App | Description | Link to prebuilt UF2 App|Description | Link to prebuilt UF2
---|---|--- ---|---|---
[hello_serial](hello_world/serial) | The obligatory Hello World program for Pico (Output over serial version) | https://rptl.io/pico-hello-serial [hello_serial](hello_world/serial) | The obligatory Hello World program for Pico (Output over serial version) |
[hello_usb](hello_world/usb) | The obligatory Hello World program for Pico (Output over USB version) | https://rptl.io/pico-hello-usb [hello_usb](hello_world/usb) | The obligatory Hello World program for Pico (Output over USB version) | https://rptl.io/pico-hello-usb
[blink](blink) | Blink an LED on and off. | https://rptl.io/pico-blink [blink](blink) | Blink an LED on and off. | https://rptl.io/pico-blink

View File

@ -3,8 +3,6 @@
# This can be dropped into an external project to help locate this SDK # This can be dropped into an external project to help locate this SDK
# It should be include()ed prior to project() # It should be include()ed prior to project()
# todo document
if (DEFINED ENV{PICO_SDK_PATH} AND (NOT PICO_SDK_PATH)) if (DEFINED ENV{PICO_SDK_PATH} AND (NOT PICO_SDK_PATH))
set(PICO_SDK_PATH $ENV{PICO_SDK_PATH}) set(PICO_SDK_PATH $ENV{PICO_SDK_PATH})
message("Using PICO_SDK_PATH from environment ('${PICO_SDK_PATH}')") message("Using PICO_SDK_PATH from environment ('${PICO_SDK_PATH}')")
@ -20,8 +18,8 @@ if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT_PATH} AND (NOT PICO_SDK_FETCH_FROM_GIT_P
message("Using PICO_SDK_FETCH_FROM_GIT_PATH from environment ('${PICO_SDK_FETCH_FROM_GIT_PATH}')") message("Using PICO_SDK_FETCH_FROM_GIT_PATH from environment ('${PICO_SDK_FETCH_FROM_GIT_PATH}')")
endif () endif ()
set(PICO_SDK_PATH "${PICO_SDK_PATH}" CACHE PATH "Path to the PICO SDK") set(PICO_SDK_PATH "${PICO_SDK_PATH}" CACHE PATH "Path to the Raspberry Pi Pico SDK")
set(PICO_SDK_FETCH_FROM_GIT "${PICO_SDK_FETCH_FROM_GIT}" CACHE BOOL "Set to ON to fetch copy of PICO SDK from git if not otherwise locatable") set(PICO_SDK_FETCH_FROM_GIT "${PICO_SDK_FETCH_FROM_GIT}" CACHE BOOL "Set to ON to fetch copy of SDK from git if not otherwise locatable")
set(PICO_SDK_FETCH_FROM_GIT_PATH "${PICO_SDK_FETCH_FROM_GIT_PATH}" CACHE FILEPATH "location to download SDK") set(PICO_SDK_FETCH_FROM_GIT_PATH "${PICO_SDK_FETCH_FROM_GIT_PATH}" CACHE FILEPATH "location to download SDK")
if (NOT PICO_SDK_PATH) if (NOT PICO_SDK_PATH)
@ -37,14 +35,14 @@ if (NOT PICO_SDK_PATH)
GIT_TAG master GIT_TAG master
) )
if (NOT pico_sdk) if (NOT pico_sdk)
message("Downloading PICO SDK") message("Downloading Raspberry Pi Pico SDK")
FetchContent_Populate(pico_sdk) FetchContent_Populate(pico_sdk)
set(PICO_SDK_PATH ${pico_sdk_SOURCE_DIR}) set(PICO_SDK_PATH ${pico_sdk_SOURCE_DIR})
endif () endif ()
set(FETCHCONTENT_BASE_DIR ${FETCHCONTENT_BASE_DIR_SAVE}) set(FETCHCONTENT_BASE_DIR ${FETCHCONTENT_BASE_DIR_SAVE})
else () else ()
message(FATAL_ERROR message(FATAL_ERROR
"PICO SDK location was not specified. Please set PICO_SDK_PATH or set PICO_SDK_FETCH_FROM_GIT to on to fetch from git." "SDK location was not specified. Please set PICO_SDK_PATH or set PICO_SDK_FETCH_FROM_GIT to on to fetch from git."
) )
endif () endif ()
endif () endif ()
@ -56,9 +54,9 @@ endif ()
set(PICO_SDK_INIT_CMAKE_FILE ${PICO_SDK_PATH}/pico_sdk_init.cmake) set(PICO_SDK_INIT_CMAKE_FILE ${PICO_SDK_PATH}/pico_sdk_init.cmake)
if (NOT EXISTS ${PICO_SDK_INIT_CMAKE_FILE}) if (NOT EXISTS ${PICO_SDK_INIT_CMAKE_FILE})
message(FATAL_ERROR "Directory '${PICO_SDK_PATH}' does not appear to contain the PICO SDK") message(FATAL_ERROR "Directory '${PICO_SDK_PATH}' does not appear to contain the Raspberry Pi Pico SDK")
endif () endif ()
set(PICO_SDK_PATH ${PICO_SDK_PATH} CACHE PATH "Path to the PICO SDK" FORCE) set(PICO_SDK_PATH ${PICO_SDK_PATH} CACHE PATH "Path to the Raspberry Pi Pico SDK" FORCE)
include(${PICO_SDK_INIT_CMAKE_FILE}) include(${PICO_SDK_INIT_CMAKE_FILE})

View File

@ -102,7 +102,7 @@ int main() {
gpio_put(PIN_BL, 1); gpio_put(PIN_BL, 1);
// Other SDKs: static image on screen, lame, boring // Other SDKs: static image on screen, lame, boring
// Pico SDK: spinning image on screen, bold, exciting // Raspberry Pi Pico SDK: spinning image on screen, bold, exciting
// Lane 0 will be u coords (bits 8:1 of addr offset), lane 1 will be v // Lane 0 will be u coords (bits 8:1 of addr offset), lane 1 will be v
// coords (bits 16:9 of addr offset), and we'll represent coords with // coords (bits 16:9 of addr offset), and we'll represent coords with