Skip to content

Commit 00722b4

Browse files
committed
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
1 parent 3793571 commit 00722b4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

scripts/pico_project.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,9 @@ def GenerateCMake(folder, params):
624624
if not params['wantExample']:
625625
# Prexisting CMake configuration - just adding cmake_header_us
626626
file.write(cmake_header_us)
627+
# If no PICO_BOARD, then add a line for that, defaulting to pico
628+
if not any(["set(PICO_BOARD" in line for line in lines]):
629+
file.write(f"set(PICO_BOARD pico CACHE STRING \"Board type\")\n\n")
627630
file.write(content)
628631
else:
629632
if any(["pico_cyw43_arch_lwip_threadsafe_background" in line for line in lines]):

0 commit comments

Comments
 (0)