coffee/barista/Makefile
Rodrigo Arias Mallo 8502ee3c5c Implement PID thremostat controller
For now only the proportional (Kp) and derivative (Kd) components are
used, the integral term is 0.
2025-11-02 19:24:02 +01:00

50 lines
987 B
Makefile

# Copyright (c) 2025 Rodrigo Arias Mallo <rodarima@gmail.com>
# 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)
thermostat.test: test/test_thermostat.o test/compat.o thermostat.o overheat.o heater.o
gcc $^ -o $@ $(LIBS)
clean:
rm -f $(TESTS) test/*.o *.o
.PHONY: test all clean