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"