Compare commits
2 commits
Author | SHA1 | Date | |
---|---|---|---|
680dde14b8 | |||
972c6c49ff |
5 changed files with 20 additions and 7 deletions
|
@ -1,6 +1,6 @@
|
||||||
# Generated Cmake Pico project file
|
# Generated Cmake Pico project file
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.26)
|
cmake_minimum_required(VERSION 3.28)
|
||||||
|
|
||||||
set(CMAKE_C_STANDARD 11)
|
set(CMAKE_C_STANDARD 11)
|
||||||
set(CMAKE_CXX_STANDARD 23)
|
set(CMAKE_CXX_STANDARD 23)
|
||||||
|
@ -14,8 +14,8 @@ set(PICO_BOARD pico CACHE STRING "Board type")
|
||||||
# Pull in Raspberry Pi Pico SDK (must be before project)
|
# Pull in Raspberry Pi Pico SDK (must be before project)
|
||||||
include(pico_sdk_import.cmake)
|
include(pico_sdk_import.cmake)
|
||||||
|
|
||||||
if (PICO_SDK_VERSION_STRING VERSION_LESS "1.5.0")
|
if (PICO_SDK_VERSION_STRING VERSION_LESS "2.0.0")
|
||||||
message(FATAL_ERROR "Raspberry Pi Pico SDK version 1.5.0 (or later) required. Your version is ${PICO_SDK_VERSION_STRING}")
|
message(FATAL_ERROR "Raspberry Pi Pico SDK version 2.0.0 (or later) required. Your version is ${PICO_SDK_VERSION_STRING}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
project(raspikeyer VERSION "0.0.1" LANGUAGES C CXX ASM)
|
project(raspikeyer VERSION "0.0.1" LANGUAGES C CXX ASM)
|
||||||
|
|
|
@ -18,9 +18,20 @@ 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 ()
|
||||||
|
|
||||||
|
if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT_TAG} AND (NOT PICO_SDK_FETCH_FROM_GIT_TAG))
|
||||||
|
set(PICO_SDK_FETCH_FROM_GIT_TAG $ENV{PICO_SDK_FETCH_FROM_GIT_TAG})
|
||||||
|
message("Using PICO_SDK_FETCH_FROM_GIT_TAG from environment ('${PICO_SDK_FETCH_FROM_GIT_TAG}')")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if (PICO_SDK_FETCH_FROM_GIT AND NOT PICO_SDK_FETCH_FROM_GIT_TAG)
|
||||||
|
set(PICO_SDK_FETCH_FROM_GIT_TAG "master")
|
||||||
|
message("Using master as default value for PICO_SDK_FETCH_FROM_GIT_TAG")
|
||||||
|
endif()
|
||||||
|
|
||||||
set(PICO_SDK_PATH "${PICO_SDK_PATH}" CACHE PATH "Path to the Raspberry Pi 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 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")
|
||||||
|
set(PICO_SDK_FETCH_FROM_GIT_TAG "${PICO_SDK_FETCH_FROM_GIT_TAG}" CACHE FILEPATH "release tag for SDK")
|
||||||
|
|
||||||
if (NOT PICO_SDK_PATH)
|
if (NOT PICO_SDK_PATH)
|
||||||
if (PICO_SDK_FETCH_FROM_GIT)
|
if (PICO_SDK_FETCH_FROM_GIT)
|
||||||
|
@ -34,14 +45,14 @@ if (NOT PICO_SDK_PATH)
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
pico_sdk
|
pico_sdk
|
||||||
GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk
|
GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk
|
||||||
GIT_TAG master
|
GIT_TAG ${PICO_SDK_FETCH_FROM_GIT_TAG}
|
||||||
GIT_SUBMODULES_RECURSE FALSE
|
GIT_SUBMODULES_RECURSE FALSE
|
||||||
)
|
)
|
||||||
else ()
|
else ()
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
pico_sdk
|
pico_sdk
|
||||||
GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk
|
GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk
|
||||||
GIT_TAG master
|
GIT_TAG ${PICO_SDK_FETCH_FROM_GIT_TAG}
|
||||||
)
|
)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
#include "bsp/board.h"
|
#include "bsp/board.h"
|
||||||
#include "hardware/adc.h"
|
#include "hardware/adc.h"
|
||||||
|
#include "pico/flash.h"
|
||||||
#include "pico/binary_info/code.h"
|
#include "pico/binary_info/code.h"
|
||||||
#include "pico/multicore.h"
|
#include "pico/multicore.h"
|
||||||
#include "pico/stdlib.h"
|
#include "pico/stdlib.h"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
#include "pico/stdlib.h"
|
#include "pico/stdlib.h"
|
||||||
|
#include "pico/flash.h"
|
||||||
|
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
|
||||||
|
@ -66,4 +67,4 @@ Settings read_settings()
|
||||||
}
|
}
|
||||||
|
|
||||||
return settings;
|
return settings;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "pico/flash.h"
|
#include "hardware/flash.h"
|
||||||
|
|
||||||
const uint16_t MAGIC_NUMBER = 4;
|
const uint16_t MAGIC_NUMBER = 4;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue