# Copyright (c) 2025 Rodrigo Arias Mallo # SPDX-License-Identifier: GPL-3.0-or-later PORT=/dev/ttyUSB0 FQBN=arduino:avr:atmega328bb OPTS=--no-color --log-level=info #OPTS+=-v PROJ=barista BUILD=build/$(subst :,.,$(FQBN)) HEX=$(BUILD)/$(PROJ).ino.hex SRC=barista.ino \ ntc.c \ ntc.h \ pinout.h \ overheat.c \ overheat.h TESTS=ntc.test \ overheat.test \ led.test # For host test programs CPPFLAGS=-I. LIBS=-lm all: $(HEX) $(HEX): $(SRC) arduino-cli compile $(OPTS) -e --fqbn $(FQBN) upload: $(HEX) avrdude -vv -p atmega328p -c arduino -P $(PORT) -b 9600 -D -U flash:w:$(HEX):i serial: picocom -b 9600 --lower-rts --lower-dtr /dev/ttyUSB0 --imap lfcrlf test: ntc.test overheat.test led.test %.test: test/test_%.o test/compat.o %.o gcc $^ -o $@ $(LIBS) clean: rm -f $(TESTS) test/*.o *.o .PHONY: test all clean