Files
RP2040-Decoder/CMakeLists.txt
T
gab-k f3ffb73b62 Copy code from flash to ram in order to not use XIP allowing writing to flash memory while both cores are running;
Motor control now operates with two states/modes;
Extended Default CV Range to 1024 - refers to NMRA/RCN standards
2024-01-05 00:37:21 +01:00

60 lines
1.5 KiB
CMake

cmake_minimum_required(VERSION 3.12)
# Pull in SDK (must be before project)
include(pico_sdk_import.cmake)
project(RP2040-Decoder C CXX ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
set(PICO_DECODER_PATH ${PROJECT_SOURCE_DIR})
# Stop the compiler from inling method calls making it easier to debug
set(PICO_DEOPTIMIZED_DEBUG 1)
# Initialize the SDK
pico_sdk_init()
add_compile_options(-Wall
-Wno-format # int != int32 _t as far as the compiler is concerned because gcc has int32_t as long int
-Wno-unused-function # we have some for the docs that aren't called
-Wno-maybe-uninitialized
)
add_executable(
RP2040-Decoder
core0.c
core0.h
core1.c
core1.h
shared.c
shared.h)
# Multiplier to lengthen XOSC startup delay to accommodate slow-starting oscillator
target_compile_definitions(
RP2040-Decoder PUBLIC
PICO_XOSC_STARTUP_DELAY_MULTIPLIER=64
)
# Add pico_multicore which is required for multicore functionality
target_link_libraries(
RP2040-Decoder
pico_stdlib
hardware_pwm
hardware_adc
hardware_flash
pico_multicore
)
# disable usb stack
pico_enable_stdio_usb(RP2040-Decoder 0)
# disable uart output (to enable put a 1 instead of the 0)
pico_enable_stdio_uart(RP2040-Decoder 0)
# Copy code to from flash to memory, then run from memory
pico_set_binary_type(RP2040-Decoder copy_to_ram)
# create map/bin/hex file etc.
pico_add_extra_outputs(RP2040-Decoder)