coffee/barista/Makefile
Rodrigo Arias Mallo eaf4e9d814 Fix upload speed
2025-10-13 21:09:06 +02:00

36 lines
727 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
# For host test programs
CPPFLAGS=-I.
LIBS=-lm
all: $(HEX)
$(HEX): barista.ino ntc.c ntc.h pinout.h
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: test_ntc
test_ntc: test/test_ntc.o ntc.o
gcc $^ -o $@ $(LIBS)
clean:
rm -f test/test_ntc.o ntc.o
.PHONY: test all clean