This commit is contained in:
2021-08-29 21:56:16 +12:00
parent 744db56269
commit 352b49ef29
8 changed files with 31 additions and 780 deletions

28
makefile Normal file
View File

@@ -0,0 +1,28 @@
MCU?=atmega328p
F_CPU=8000000
PROG?=arduino
PORT?=COM5
CC=avr-g++
OBJCOPY=avr-objcopy
CFLAGS=-Wall -g -mmcu=${MCU} -DF_CPU=${F_CPU} -I.
TARGET=main
SRCS= src/*.cpp $(wildcard lib/*/src/*.cpp)
all: build flash
build:
${CC} ${CFLAGS} -o bin/${MODE}.bin ${SRCS} test/${MODE}/main.cpp -O2
${CC} ${CFLAGS} -o bin/${MODE}.elf ${SRCS} test/${MODE}/main.cpp -O2
${OBJCOPY} -j .text -j .data -O ihex bin/${MODE}.bin bin/${MODE}.hex
flash:
avrdude -p ${MCU} -c ${PROG} -P ${PORT} ${BAUD} -U flash:w:bin/${MODE}.hex
clean:
rm -f bin/*
term:
python3 lib/usart/term.py
avarice:
avarice --program --file bin/main.elf --part atmega32 --dragon :4242