Skip to content

Commit

Permalink
Add PICO_BOARD line to imported projects if not already present (#46)
Browse files Browse the repository at this point in the history
Defaults to pico board for now, but board selection can be added in future
  • Loading branch information
will-v-pi committed Oct 30, 2024
1 parent 3793571 commit 00722b4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/pico_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]):
Expand Down

0 comments on commit 00722b4

Please sign in to comment.