TARGET = thumbv8m.main-none-eabihf
CHIP = STM32U575ZI
BIN = main
MODE ?= release
ELF = target/$(TARGET)/$(MODE)/$(BIN)
PROBE = probe-rs

.PHONY: all build flash empty

all: build flash

build:
	cargo build --target $(TARGET) --$(MODE)

flash: build
	$(PROBE) run --chip $(CHIP) $(ELF)

empty:
	$(PROBE) erase --chip $(CHIP)

