diff --git a/Makefile b/Makefile index 5a7401c..e1f7428 100644 --- a/Makefile +++ b/Makefile @@ -3,8 +3,8 @@ BUILDFOLDER = ./build/ TARGET = $(BUILDFOLDER)$(TARGETNAME) INC = -Isrc/include -I/usr/lib/avr/include/ -CFLAGS = -Wall -Wpedantic -Wextra -g -Os -mmcu=atmega32u4 -CPPFLAGS = -DF_CPU=8000000UL +CFLAGS = -Wall -Wpedantic -Wextra -g -Os -mmcu=atmega328p +CPPFLAGS = -DF_CPU=16000000UL SRC = $(wildcard src/*.c) @@ -14,6 +14,10 @@ $(TARGET): $(SRC) mkdir -p build avr-gcc -o $@.elf $^ $(CPPFLAGS) $(CFLAGS) $(INC) avr-objcopy -j .text -j .data -O ihex $@.elf $@.hex + rm $@.elf + +flash: + avrdude -p m328p -P /dev/ttyUSB0 -c arduino -b 57600 -Uflash:w:"$(TARGET).hex":i clean: rm -fr ./src/*.o ./build/