improve board config setup
This commit is contained in:
17952
basic1_feather_tft.dis
Normal file
17952
basic1_feather_tft.dis
Normal file
File diff suppressed because it is too large
Load Diff
BIN
basic1_feather_tft.uf2
Normal file
BIN
basic1_feather_tft.uf2
Normal file
Binary file not shown.
17947
basic1_pico2_eink.dis
Normal file
17947
basic1_pico2_eink.dis
Normal file
File diff suppressed because it is too large
Load Diff
BIN
basic1_pico2_eink.uf2
Normal file
BIN
basic1_pico2_eink.uf2
Normal file
Binary file not shown.
17947
basic1_pico2_tft.dis
Normal file
17947
basic1_pico2_tft.dis
Normal file
File diff suppressed because it is too large
Load Diff
BIN
basic1_pico2_tft.uf2
Normal file
BIN
basic1_pico2_tft.uf2
Normal file
Binary file not shown.
159
board_config.h
159
board_config.h
@@ -1,129 +1,50 @@
|
||||
#ifndef BOARD_CONFIG_H
|
||||
#define BOARD_CONFIG_H
|
||||
|
||||
#include "pico/stdlib.h"
|
||||
// ============================================================================
|
||||
// BOARD CONFIGURATION SELECTOR
|
||||
// ============================================================================
|
||||
// This file serves as a selector for different board configurations.
|
||||
// Uncomment ONE of the board defines below to select your hardware setup.
|
||||
//
|
||||
// Available boards:
|
||||
// - BOARD_FEATHER_TFT: Adafruit Feather RP2350 with 4.0" TFT ST7796
|
||||
// - BOARD_PICO2_TFT: Raspberry Pi Pico 2 with 4.0" TFT ST7796
|
||||
// - BOARD_PICO2_EINK: Raspberry Pi Pico 2 with E-Ink Display
|
||||
//
|
||||
// To switch boards: Simply uncomment one board and comment out the others.
|
||||
// ============================================================================
|
||||
|
||||
// Forward declare display and touch types (actual enums in respective headers)
|
||||
// Display options: DISPLAY_TYPE_ST7796, DISPLAY_TYPE_ST7789, DISPLAY_TYPE_EPAPER
|
||||
// Touch options: TOUCH_TYPE_FT6336U, TOUCH_TYPE_NONE
|
||||
// ---- SELECT YOUR BOARD HERE ----
|
||||
#define BOARD_FEATHER_TFT // Feather RP2350 + 4.0" TFT ST7796
|
||||
// #define BOARD_PICO2_TFT // Pico 2 + 4.0" TFT ST7796
|
||||
// #define BOARD_PICO2_EINK // Pico 2 + E-Ink Display
|
||||
// --------------------------------
|
||||
|
||||
// Board-specific pin definitions and configurations
|
||||
// ============================================================================
|
||||
// Display Type Constants (for use in board configs)
|
||||
// ============================================================================
|
||||
#define DISPLAY_TYPE_ST7796_VAL 0
|
||||
#define DISPLAY_TYPE_ST7789_VAL 1
|
||||
#define DISPLAY_TYPE_EPAPER_VAL 2
|
||||
|
||||
#if defined(PICO_BOARD_ADAFRUIT_FEATHER_RP2350)
|
||||
// Adafruit Feather RP2350 pinout
|
||||
#define BOARD_NAME "Adafruit Feather RP2350"
|
||||
|
||||
// Display configuration
|
||||
#define DISPLAY_WIDTH 480
|
||||
#define DISPLAY_HEIGHT 320
|
||||
#define DISPLAY_TYPE_SELECTED 0 // DISPLAY_TYPE_ST7796
|
||||
|
||||
// Touch configuration
|
||||
#define TOUCH_TYPE_SELECTED 0 // TOUCH_TYPE_FT6336U
|
||||
#define TOUCH_SWAP_XY true
|
||||
#define TOUCH_INVERT_X true
|
||||
#define TOUCH_INVERT_Y false
|
||||
|
||||
// SPI pins for display - Feather RP2350 with 4.0" TFT
|
||||
#define DISPLAY_SPI_PORT spi1
|
||||
#define DISPLAY_SCK_PIN 10 // D10 (SCK)
|
||||
#define DISPLAY_MOSI_PIN 11 // D11 (MOSI)
|
||||
#define DISPLAY_MISO_PIN 20 // Not used for display
|
||||
#define DISPLAY_CS_PIN 7 // D13 (CS)
|
||||
#define DISPLAY_DC_PIN 4 // D4 (DC)
|
||||
#define DISPLAY_RST_PIN 9 // D9 (RST)
|
||||
#define DISPLAY_BL_PIN 6 // D6 (Backlight)
|
||||
#define DISPLAY_BUSY_PIN 13 // For e-paper displays
|
||||
|
||||
// I2C pins for touch - Feather I2C default
|
||||
#define TOUCH_I2C_PORT i2c1
|
||||
#define TOUCH_SDA_PIN 2
|
||||
#define TOUCH_SCL_PIN 3
|
||||
#define TOUCH_INT_PIN 25
|
||||
#define TOUCH_RST_PIN 28
|
||||
|
||||
// SD card pins (shared SPI with display)
|
||||
#define SD_SPI_PORT spi1
|
||||
#define SD_CS_PIN 5
|
||||
#define SD_MISO_PIN 24
|
||||
#define SD_MOSI_PIN 11
|
||||
#define SD_SCK_PIN 10
|
||||
|
||||
#elif defined(PICO_BOARD) && (PICO_BOARD == pico2 || PICO_BOARD == pico2_w)
|
||||
// Raspberry Pi Pico 2 / Pico 2 W pinout
|
||||
#define BOARD_NAME "Raspberry Pi Pico 2"
|
||||
|
||||
// Display configuration
|
||||
#define DISPLAY_WIDTH 480
|
||||
#define DISPLAY_HEIGHT 320
|
||||
#define DISPLAY_TYPE_SELECTED 0 // DISPLAY_TYPE_ST7796
|
||||
|
||||
// Touch configuration
|
||||
#define TOUCH_TYPE_SELECTED 0 // TOUCH_TYPE_FT6336U
|
||||
#define TOUCH_SWAP_XY true
|
||||
#define TOUCH_INVERT_X true
|
||||
#define TOUCH_INVERT_Y false
|
||||
|
||||
// SPI pins for display (using SPI0)
|
||||
#define DISPLAY_SPI_PORT spi0
|
||||
#define DISPLAY_SCK_PIN 2 // GP2
|
||||
#define DISPLAY_MOSI_PIN 3 // GP3
|
||||
#define DISPLAY_MISO_PIN 4 // GP4
|
||||
#define DISPLAY_CS_PIN 5 // GP5
|
||||
#define DISPLAY_DC_PIN 6 // GP6
|
||||
#define DISPLAY_RST_PIN 7 // GP7
|
||||
#define DISPLAY_BL_PIN 8 // GP8
|
||||
#define DISPLAY_BUSY_PIN 9 // GP9 - For e-paper displays
|
||||
|
||||
// I2C pins for touch (using I2C0)
|
||||
#define TOUCH_I2C_PORT i2c0
|
||||
#define TOUCH_SDA_PIN 12 // GP12
|
||||
#define TOUCH_SCL_PIN 13 // GP13
|
||||
#define TOUCH_INT_PIN 14 // GP14
|
||||
#define TOUCH_RST_PIN 15 // GP15
|
||||
|
||||
// SD card pins (separate SPI1)
|
||||
#define SD_SPI_PORT spi1
|
||||
#define SD_CS_PIN 17 // GP17
|
||||
|
||||
// ============================================================================
|
||||
// Touch Type Constants (for use in board configs)
|
||||
// ============================================================================
|
||||
#define TOUCH_TYPE_FT6336U_VAL 0
|
||||
#define TOUCH_TYPE_NONE_VAL 1
|
||||
|
||||
// ============================================================================
|
||||
// Load Board-Specific Configuration
|
||||
// ============================================================================
|
||||
#ifdef BOARD_FEATHER_TFT
|
||||
#include "board_configs/board_feather_tft.h"
|
||||
#elif defined(BOARD_PICO2_TFT)
|
||||
#include "board_configs/board_pico2_tft.h"
|
||||
#elif defined(BOARD_PICO2_EINK)
|
||||
#include "board_configs/board_pico2_eink.h"
|
||||
#else
|
||||
#warning "Unknown board! Using default Pico 2 pinout"
|
||||
#define BOARD_NAME "Unknown Board (Pico 2 defaults)"
|
||||
|
||||
// Display configuration
|
||||
#define DISPLAY_WIDTH 480
|
||||
#define DISPLAY_HEIGHT 320
|
||||
#define DISPLAY_TYPE_SELECTED 0 // DISPLAY_TYPE_ST7796
|
||||
|
||||
// Touch configuration
|
||||
#define TOUCH_TYPE_SELECTED 0 // TOUCH_TYPE_FT6336U
|
||||
#define TOUCH_SWAP_XY true
|
||||
#define TOUCH_INVERT_X true
|
||||
#define TOUCH_INVERT_Y false
|
||||
|
||||
// Default to Pico 2 pinout
|
||||
#define DISPLAY_SPI_PORT spi0
|
||||
#define DISPLAY_SCK_PIN 2
|
||||
#define DISPLAY_MOSI_PIN 3
|
||||
#define DISPLAY_MISO_PIN 4
|
||||
#define DISPLAY_CS_PIN 5
|
||||
#define DISPLAY_DC_PIN 6
|
||||
#define DISPLAY_RST_PIN 7
|
||||
#define DISPLAY_BL_PIN 8
|
||||
#define DISPLAY_BUSY_PIN 9 // For e-paper displays
|
||||
|
||||
#define TOUCH_I2C_PORT i2c0
|
||||
#define TOUCH_SDA_PIN 12
|
||||
#define TOUCH_SCL_PIN 13
|
||||
#define TOUCH_INT_PIN 14
|
||||
#define TOUCH_RST_PIN 15
|
||||
|
||||
#define SD_SPI_PORT spi1
|
||||
#define SD_CS_PIN 17
|
||||
#error "No board selected! Please uncomment one BOARD_xxx define in board_config.h"
|
||||
#endif
|
||||
|
||||
// Common configuration
|
||||
#define SPI_BAUDRATE (32 * 1000 * 1000) // 32 MHz for display
|
||||
#define I2C_BAUDRATE (400 * 1000) // 400 kHz for touch
|
||||
|
||||
#endif // BOARD_CONFIG_H
|
||||
|
||||
97
board_configs/README.md
Normal file
97
board_configs/README.md
Normal file
@@ -0,0 +1,97 @@
|
||||
# Board Configuration System
|
||||
|
||||
This directory contains board-specific configuration files for different hardware setups.
|
||||
|
||||
## How to Switch Boards
|
||||
|
||||
Edit [`board_config.h`](../board_config.h) and uncomment the board you want to use:
|
||||
|
||||
```cpp
|
||||
// ---- SELECT YOUR BOARD HERE ----
|
||||
#define BOARD_FEATHER_TFT // Feather RP2350 + 4.0" TFT ST7796
|
||||
// #define BOARD_PICO2_TFT // Pico 2 + 4.0" TFT ST7796
|
||||
// #define BOARD_PICO2_EINK // Pico 2 + E-Ink Display
|
||||
// --------------------------------
|
||||
```
|
||||
|
||||
**Important:** Only one board should be uncommented at a time!
|
||||
|
||||
## Available Boards
|
||||
|
||||
### 1. BOARD_FEATHER_TFT
|
||||
**File:** `board_feather_tft.h`
|
||||
**Hardware:** Adafruit Feather RP2350 with 4.0" TFT ST7796
|
||||
**Display:** ST7796 (480x320 RGB TFT)
|
||||
**Touch:** FT6336U capacitive touch
|
||||
**Features:** High-speed refresh, backlight control, SD card
|
||||
|
||||
### 2. BOARD_PICO2_TFT
|
||||
**File:** `board_pico2_tft.h`
|
||||
**Hardware:** Raspberry Pi Pico 2 with 4.0" TFT ST7796
|
||||
**Display:** ST7796 (480x320 RGB TFT)
|
||||
**Touch:** FT6336U capacitive touch
|
||||
**Features:** High-speed refresh, backlight control, SD card
|
||||
|
||||
### 3. BOARD_PICO2_EINK
|
||||
**File:** `board_pico2_eink.h`
|
||||
**Hardware:** Raspberry Pi Pico 2 with E-Ink Display
|
||||
**Display:** E-Paper (400x300 monochrome)
|
||||
**Touch:** None (configurable)
|
||||
**Features:** Ultra low power, BUSY pin for refresh status
|
||||
|
||||
## Adding a New Board
|
||||
|
||||
1. Create a new header file: `board_configs/board_your_name.h`
|
||||
2. Copy the structure from an existing board file
|
||||
3. Update all pin definitions for your hardware
|
||||
4. Add a `#define BOARD_YOUR_NAME` option in `board_config.h`
|
||||
5. Add an `#elif defined(BOARD_YOUR_NAME)` section
|
||||
|
||||
## Configuration Structure
|
||||
|
||||
Each board config file must define:
|
||||
|
||||
### Display Settings
|
||||
- `BOARD_NAME` - Human-readable board name
|
||||
- `DISPLAY_WIDTH`, `DISPLAY_HEIGHT` - Screen dimensions
|
||||
- `DISPLAY_TYPE_SELECTED` - Display driver type (0=ST7796, 2=EPAPER)
|
||||
|
||||
### Display Pins
|
||||
- `DISPLAY_SPI_PORT` - SPI instance (spi0 or spi1)
|
||||
- `DISPLAY_SCK_PIN`, `DISPLAY_MOSI_PIN`, `DISPLAY_MISO_PIN`
|
||||
- `DISPLAY_CS_PIN` - Chip select
|
||||
- `DISPLAY_DC_PIN` - Data/Command
|
||||
- `DISPLAY_RST_PIN` - Reset
|
||||
- `DISPLAY_BL_PIN` - Backlight (-1 for e-ink)
|
||||
- `DISPLAY_BUSY_PIN` - E-paper busy signal (-1 for TFT)
|
||||
|
||||
### Touch Settings
|
||||
- `TOUCH_TYPE_SELECTED` - Touch driver type (0=FT6336U, 1=NONE)
|
||||
- `TOUCH_SWAP_XY`, `TOUCH_INVERT_X`, `TOUCH_INVERT_Y` - Orientation
|
||||
|
||||
### Touch Pins
|
||||
- `TOUCH_I2C_PORT` - I2C instance (i2c0 or i2c1)
|
||||
- `TOUCH_SDA_PIN`, `TOUCH_SCL_PIN`
|
||||
- `TOUCH_INT_PIN` - Interrupt
|
||||
- `TOUCH_RST_PIN` - Reset
|
||||
|
||||
### SD Card Pins (Optional)
|
||||
- `SD_SPI_PORT`, `SD_CS_PIN`, `SD_MISO_PIN`, `SD_MOSI_PIN`, `SD_SCK_PIN`
|
||||
|
||||
### Timing
|
||||
- `SPI_BAUDRATE` - SPI clock speed (32MHz for TFT, 4MHz for e-ink)
|
||||
- `I2C_BAUDRATE` - I2C clock speed (typically 400kHz)
|
||||
|
||||
## Build Process
|
||||
|
||||
The build system automatically uses the selected board configuration:
|
||||
|
||||
```bash
|
||||
# Build for currently selected board
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake ..
|
||||
make -j4
|
||||
```
|
||||
|
||||
No need to specify board-specific CMake flags - just edit `board_config.h` to switch!
|
||||
52
board_configs/board_feather_tft.h
Normal file
52
board_configs/board_feather_tft.h
Normal file
@@ -0,0 +1,52 @@
|
||||
#ifndef BOARD_FEATHER_TFT_H
|
||||
#define BOARD_FEATHER_TFT_H
|
||||
|
||||
#include "pico/stdlib.h"
|
||||
|
||||
// ============================================================================
|
||||
// Adafruit Feather RP2350 with 4.0" TFT ST7796
|
||||
// ============================================================================
|
||||
|
||||
#define BOARD_NAME "Adafruit Feather RP2350 + 4.0\" TFT ST7796"
|
||||
|
||||
// Display Configuration
|
||||
#define DISPLAY_WIDTH 480
|
||||
#define DISPLAY_HEIGHT 320
|
||||
#define DISPLAY_TYPE_SELECTED 0 // DISPLAY_TYPE_ST7796_VAL
|
||||
|
||||
// Touch Configuration
|
||||
#define TOUCH_TYPE_SELECTED 0 // TOUCH_TYPE_FT6336U_VAL
|
||||
#define TOUCH_SWAP_XY true
|
||||
#define TOUCH_INVERT_X true
|
||||
#define TOUCH_INVERT_Y false
|
||||
|
||||
// SPI pins for display - Feather RP2350 with 4.0" TFT
|
||||
#define DISPLAY_SPI_PORT spi1
|
||||
#define DISPLAY_SCK_PIN 10 // D10 (SCK)
|
||||
#define DISPLAY_MOSI_PIN 11 // D11 (MOSI)
|
||||
#define DISPLAY_MISO_PIN 20 // Not used for display
|
||||
#define DISPLAY_CS_PIN 7 // D13 (CS)
|
||||
#define DISPLAY_DC_PIN 4 // D4 (DC)
|
||||
#define DISPLAY_RST_PIN 9 // D9 (RST)
|
||||
#define DISPLAY_BL_PIN 6 // D6 (Backlight)
|
||||
#define DISPLAY_BUSY_PIN -1 // Not used for TFT
|
||||
|
||||
// I2C pins for touch - Feather I2C default
|
||||
#define TOUCH_I2C_PORT i2c1
|
||||
#define TOUCH_SDA_PIN 2
|
||||
#define TOUCH_SCL_PIN 3
|
||||
#define TOUCH_INT_PIN 25
|
||||
#define TOUCH_RST_PIN 28
|
||||
|
||||
// SD card pins (shared SPI with display)
|
||||
#define SD_SPI_PORT spi1
|
||||
#define SD_CS_PIN 5
|
||||
#define SD_MISO_PIN 24
|
||||
#define SD_MOSI_PIN 11
|
||||
#define SD_SCK_PIN 10
|
||||
|
||||
// Common configuration
|
||||
#define SPI_BAUDRATE (32 * 1000 * 1000) // 32 MHz for display
|
||||
#define I2C_BAUDRATE (400 * 1000) // 400 kHz for touch
|
||||
|
||||
#endif // BOARD_FEATHER_TFT_H
|
||||
52
board_configs/board_pico2_eink.h
Normal file
52
board_configs/board_pico2_eink.h
Normal file
@@ -0,0 +1,52 @@
|
||||
#ifndef BOARD_PICO2_EINK_H
|
||||
#define BOARD_PICO2_EINK_H
|
||||
|
||||
#include "pico/stdlib.h"
|
||||
|
||||
// ============================================================================
|
||||
// Raspberry Pi Pico 2 with E-Ink Display
|
||||
// ============================================================================
|
||||
|
||||
#define BOARD_NAME "Raspberry Pi Pico 2 + E-Ink Display"
|
||||
|
||||
// Display Configuration
|
||||
#define DISPLAY_WIDTH 400
|
||||
#define DISPLAY_HEIGHT 300
|
||||
#define DISPLAY_TYPE_SELECTED 2 // DISPLAY_TYPE_EPAPER_VAL
|
||||
|
||||
// Touch Configuration (if your e-ink has touch, otherwise use TOUCH_TYPE_NONE)
|
||||
#define TOUCH_TYPE_SELECTED 1 // TOUCH_TYPE_NONE_VAL
|
||||
#define TOUCH_SWAP_XY false
|
||||
#define TOUCH_INVERT_X false
|
||||
#define TOUCH_INVERT_Y false
|
||||
|
||||
// SPI pins for E-Ink display (using SPI0)
|
||||
#define DISPLAY_SPI_PORT spi0
|
||||
#define DISPLAY_SCK_PIN 2 // GP2
|
||||
#define DISPLAY_MOSI_PIN 3 // GP3
|
||||
#define DISPLAY_MISO_PIN 4 // GP4 (often not used by e-paper)
|
||||
#define DISPLAY_CS_PIN 5 // GP5
|
||||
#define DISPLAY_DC_PIN 6 // GP6 (Data/Command)
|
||||
#define DISPLAY_RST_PIN 7 // GP7 (Reset)
|
||||
#define DISPLAY_BL_PIN 8 // GP8 - Not used for e-ink, but needs valid pin number
|
||||
#define DISPLAY_BUSY_PIN 9 // GP9 - E-paper BUSY pin (critical!)
|
||||
|
||||
// I2C pins for touch (if using touch-enabled e-ink)
|
||||
#define TOUCH_I2C_PORT i2c0
|
||||
#define TOUCH_SDA_PIN 12 // GP12
|
||||
#define TOUCH_SCL_PIN 13 // GP13
|
||||
#define TOUCH_INT_PIN 14 // GP14
|
||||
#define TOUCH_RST_PIN 15 // GP15
|
||||
|
||||
// SD card pins (separate SPI1) - optional
|
||||
#define SD_SPI_PORT spi1
|
||||
#define SD_CS_PIN 17 // GP17
|
||||
#define SD_MISO_PIN 16 // GP16
|
||||
#define SD_MOSI_PIN 19 // GP19
|
||||
#define SD_SCK_PIN 18 // GP18
|
||||
|
||||
// Common configuration
|
||||
#define SPI_BAUDRATE (4 * 1000 * 1000) // 4 MHz for e-paper (slower than TFT)
|
||||
#define I2C_BAUDRATE (400 * 1000) // 400 kHz for touch
|
||||
|
||||
#endif // BOARD_PICO2_EINK_H
|
||||
52
board_configs/board_pico2_tft.h
Normal file
52
board_configs/board_pico2_tft.h
Normal file
@@ -0,0 +1,52 @@
|
||||
#ifndef BOARD_PICO2_TFT_H
|
||||
#define BOARD_PICO2_TFT_H
|
||||
|
||||
#include "pico/stdlib.h"
|
||||
|
||||
// ============================================================================
|
||||
// Raspberry Pi Pico 2 with 4.0" TFT ST7796
|
||||
// ============================================================================
|
||||
|
||||
#define BOARD_NAME "Raspberry Pi Pico 2 + 4.0\" TFT ST7796"
|
||||
|
||||
// Display Configuration
|
||||
#define DISPLAY_WIDTH 480
|
||||
#define DISPLAY_HEIGHT 320
|
||||
#define DISPLAY_TYPE_SELECTED 0 // DISPLAY_TYPE_ST7796_VAL
|
||||
|
||||
// Touch Configuration
|
||||
#define TOUCH_TYPE_SELECTED 0 // TOUCH_TYPE_FT6336U_VAL
|
||||
#define TOUCH_SWAP_XY true
|
||||
#define TOUCH_INVERT_X true
|
||||
#define TOUCH_INVERT_Y false
|
||||
|
||||
// SPI pins for display (using SPI0)
|
||||
#define DISPLAY_SPI_PORT spi0
|
||||
#define DISPLAY_SCK_PIN 2 // GP2
|
||||
#define DISPLAY_MOSI_PIN 3 // GP3
|
||||
#define DISPLAY_MISO_PIN 4 // GP4
|
||||
#define DISPLAY_CS_PIN 5 // GP5
|
||||
#define DISPLAY_DC_PIN 6 // GP6
|
||||
#define DISPLAY_RST_PIN 7 // GP7
|
||||
#define DISPLAY_BL_PIN 8 // GP8
|
||||
#define DISPLAY_BUSY_PIN -1 // Not used for TFT
|
||||
|
||||
// I2C pins for touch (using I2C0)
|
||||
#define TOUCH_I2C_PORT i2c0
|
||||
#define TOUCH_SDA_PIN 12 // GP12
|
||||
#define TOUCH_SCL_PIN 13 // GP13
|
||||
#define TOUCH_INT_PIN 14 // GP14
|
||||
#define TOUCH_RST_PIN 15 // GP15
|
||||
|
||||
// SD card pins (separate SPI1)
|
||||
#define SD_SPI_PORT spi1
|
||||
#define SD_CS_PIN 17 // GP17
|
||||
#define SD_MISO_PIN 16 // GP16
|
||||
#define SD_MOSI_PIN 19 // GP19
|
||||
#define SD_SCK_PIN 18 // GP18
|
||||
|
||||
// Common configuration
|
||||
#define SPI_BAUDRATE (32 * 1000 * 1000) // 32 MHz for display
|
||||
#define I2C_BAUDRATE (400 * 1000) // 400 kHz for touch
|
||||
|
||||
#endif // BOARD_PICO2_TFT_H
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user