From f3ef1be37c14168ee054346dbf9ef3a0c78a571b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bengt=20Sj=C3=B6l=C3=A9n?= Date: Wed, 4 Feb 2026 17:07:52 +0100 Subject: [PATCH] Add DEBUG_PROBE_BOARD setting in config and include board config header based on that --- CMakeLists.txt | 6 ++++++ src/probe_config.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7eeb2e05e..2fa7cf0e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,6 +63,8 @@ target_compile_definitions (debugprobe PRIVATE PICO_RP2040_USB_DEVICE_ENUMERATION_FIX=1 ) +set(DEBUG_PROBE_BOARD "debug_probe" CACHE STRING "Debug Probe board to build for") + option (DEBUG_ON_PICO "Compile firmware for the Pico instead of Debug Probe" OFF) if (DEBUG_ON_PICO) target_compile_definitions (debugprobe PRIVATE @@ -79,6 +81,10 @@ if (DEBUG_ON_PICO) else () message(SEND_ERROR "Unsupported board ${PICO_BOARD}") endif () +else () + target_compile_definitions(debugprobe PRIVATE + BOARD_CONFIG_HEADER=\"board_${DEBUG_PROBE_BOARD}_config.h\" + ) endif () diff --git a/src/probe_config.h b/src/probe_config.h index 5c5e14909..410115d55 100644 --- a/src/probe_config.h +++ b/src/probe_config.h @@ -68,7 +68,7 @@ do { \ #ifdef DEBUG_ON_PICO #include "board_pico_config.h" #else -#include "board_debug_probe_config.h" +#include BOARD_CONFIG_HEADER #endif //#include "board_example_config.h"