improve board config setup

This commit is contained in:
Adolfo Reyna
2026-01-29 14:32:36 -05:00
parent 3a08cb5119
commit de6411d2fa
12 changed files with 54147 additions and 120 deletions

View File

@@ -2,6 +2,7 @@
# Build and Flash Script for Pico RP2350
# This script compiles the project and flashes it to the board
# Board selection is done in board_config.h (not via CMake)
set -e # Exit on error
@@ -15,11 +16,17 @@ echo " Pico RP2350 Build and Flash Script"
echo "=========================================="
echo ""
# Detect which board is selected in board_config.h
SELECTED_BOARD=$(grep "^#define BOARD_" "${PROJECT_DIR}/board_config.h" | grep -v "^//" | head -1 | awk '{print $2}')
echo "Selected board: ${SELECTED_BOARD}"
echo "(Change in board_config.h to build for different board)"
echo ""
# Check if build directory exists and has build.ninja
if [ ! -f "${BUILD_DIR}/build.ninja" ]; then
echo "⚠ Build not configured. Running cmake..."
cd "${PROJECT_DIR}"
cmake -B build -G Ninja -DPICO_BOARD=adafruit_feather_rp2350
cmake -B build -G Ninja
echo ""
fi