Skip to content

Commit

Permalink
Add board and platform to build script
Browse files Browse the repository at this point in the history
  • Loading branch information
webhdx committed Dec 16, 2024
1 parent 2ea01b8 commit 9f2d125
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
25 changes: 24 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,29 @@ project(picoboot LANGUAGES C CXX ASM VERSION ${CMAKE_GIT_REPO_VERSION})
# Initialise the Raspberry Pi Pico SDK
pico_sdk_init()

# Target board pico, pico_w, pico2, pico2_w
if(DEFINED PICO_BOARD)
message("PICO_BOARD is defined as ${PICO_BOARD}")
else()
message("PICO_BOARD not defined, defaulting to 'pico'")
set(PICO_BOARD pico)
endif()

# Target platform rp2040, rp2350 (rp2350-arm-s)
if(DEFINED PICO_PLATFORM)
message("PICO_PLATFORM is defined as ${PICO_PLATFORM}")
else()
if(DEFINED PICO_BOARD)
if(PICO_BOARD STREQUAL "pico2")
set(PICO_PLATFORM rp2350-arm-s)
message("PICO_PLATFORM not defined, board is ${PICO_BOARD} setting PICO_PLATFORM to ${PICO_PLATFORM}")
endif()
else()
message("PICO_PLATFORM not defined, defaulting to 'rp2040'")
set(PICO_PLATFORM rp2040)
endif()
endif()

add_executable(picoboot
src/picoboot.c
src/pio.c
Expand All @@ -32,7 +55,7 @@ pico_generate_pio_header(picoboot
)

pico_set_program_name(picoboot "PicoBoot")
pico_set_program_description(picoboot "RP2040 based modchip for Nintendo GameCube")
pico_set_program_description(picoboot "RP2040/RP2350 based modchip for Nintendo GameCube")
pico_set_program_version(picoboot ${GIT_REPO_VERSION})
pico_set_program_url(picoboot "https://github.com/webhdx/PicoBoot")

Expand Down
4 changes: 3 additions & 1 deletion src/version.h.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#pragma once

#define PICOBOOT_VERSION "${GIT_REPO_VERSION}"
#define PICOBOOT_VERSION "${GIT_REPO_VERSION}"
#define PICOBOOT_BOARD "${PICO_BOARD}"
#define PICOBOOT_PLATFORM "${PICO_PLATFORM}"

0 comments on commit 9f2d125

Please sign in to comment.