Skip to content
Open
30 changes: 30 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
SKETCH_PATH = $(shell pwd)/sketches/BLE_Scratch
scratch-gui-version = v3.2.37

.PHONY: init
Expand Down Expand Up @@ -35,3 +36,32 @@ fmt:
fmt-check:
npx prettier --check "scratch-arduino-extensions/**/*.{js,jsx,ts,tsx,json,css,scss,md}"
find . -name '*.ino' -or -name '*.cpp' -or -name '*.h' | xargs clang-format -n -Werror

.PHONY: compile-all
compile-all: compile-nano33ble compile-nanorp2040connect

.PHONY: compile-nano33ble
compile-nano33ble:
arduino-cli compile -v -e --profile nano33ble ${SKETCH_PATH}

.PHONY: compile-nanorp2040connect
compile-nanorp2040connect:
arduino-cli compile -v -e --profile nanorp2040connect ${SKETCH_PATH}

.PHONY: upload-nano33ble
upload-nano33ble:
arduino-cli upload -v \
-i "${SKETCH_PATH}/build/arduino.mbed_nano.nano33ble/BLE_Scratch.ino.bin" \
-b arduino:mbed_nano:nano33ble \
-p "$(shell arduino-cli board list | grep "arduino:mbed_nano:nano33ble" | awk '{print $$1}' | head -n 1)"

.PHONY: upload-nanorp2040connect
upload-nanorp2040connect:
arduino-cli upload -v \
-i "${SKETCH_PATH}/build/arduino.mbed_nano.nanorp2040connect/BLE_Scratch.ino.bin" \
-b arduino:mbed_nano:nanorp2040connect \
-p "$(shell arduino-cli board list | grep "arduino:mbed_nano:nanorp2040connect" | awk '{print $$1}' | head -n 1)"

.PHONY: monitor
monitor:
sh -c "arduino-cli monitor -p "$(shell arduino-cli board list | grep -E "arduino:mbed_nano:nano33ble|arduino:mbed_nano:nanorp2040connect" | awk '{print $$1}' | head -n 1)""
7 changes: 0 additions & 7 deletions scripts/compile.sh

This file was deleted.

13 changes: 0 additions & 13 deletions scripts/upload.sh

This file was deleted.

Loading