From 00722b40417d72d7a7f92819a73fdf360c817c98 Mon Sep 17 00:00:00 2001 From: William Vinnicombe Date: Wed, 30 Oct 2024 16:07:18 +0000 Subject: [PATCH] Add PICO_BOARD line to imported projects if not already present (#46) Defaults to pico board for now, but board selection can be added in future --- scripts/pico_project.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/pico_project.py b/scripts/pico_project.py index 06e4e7ba..249f9f74 100644 --- a/scripts/pico_project.py +++ b/scripts/pico_project.py @@ -624,6 +624,9 @@ def GenerateCMake(folder, params): if not params['wantExample']: # Prexisting CMake configuration - just adding cmake_header_us file.write(cmake_header_us) + # If no PICO_BOARD, then add a line for that, defaulting to pico + if not any(["set(PICO_BOARD" in line for line in lines]): + file.write(f"set(PICO_BOARD pico CACHE STRING \"Board type\")\n\n") file.write(content) else: if any(["pico_cyw43_arch_lwip_threadsafe_background" in line for line in lines]):