Files
led-hoop/c/Makefile
T
jimmyandCursor b783d97f13 Add Pico 2 W C firmware with Soft-AP and LED blink.
Bring up a minimal cyw43 Soft-AP (powersave disabled) plus USB serial blink example, with Makefile flash/monitor helpers and build ignore.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-20 21:18:17 +12:00

44 lines
870 B
Makefile

# Pico 2 W firmware
#
# make build | flash | test | reset | monitor | clean
# make monitor PORT=/dev/ttyACM0
PICO_SDK_PATH ?= $(HOME)/pico-sdk
CMAKE_PREFIX_PATH ?= $(HOME)/.local
BUILD_DIR ?= build
TARGET ?= led_hoop
PORT ?= /dev/ttyACM0
BAUD ?= 115200
FLASH_WAIT_S ?= 20
export PICO_SDK_PATH
export PATH := $(HOME)/.local/bin:$(PATH)
UF2 := $(BUILD_DIR)/$(TARGET).uf2
.PHONY: all build flash test reset monitor clean
all: build
build:
cmake -S . -B $(BUILD_DIR) -DCMAKE_PREFIX_PATH=$(CMAKE_PREFIX_PATH)
cmake --build $(BUILD_DIR) -j$$(nproc)
flash: build
picotool load -fx $(UF2)
test: build
picotool info $(UF2)
reset:
picotool reboot -af
monitor:
@echo "Waiting for $(PORT)..."
@until [ -e "$(PORT)" ]; do sleep 0.25; done
@sleep 0.5
picocom -b $(BAUD) $(PORT)
clean:
rm -rf $(BUILD_DIR)