DEVICE=atmega328p
CC= avr-g++
-CFLAGS= -Wall -mmcu=$(DEVICE) -Os -DF_CPU=12000000 -c
-LFLAGS= -Wall -mmcu=$(DEVICE) -Os -DF_CPU=12000000 -Wl,-u,vfprintf -lprintf_flt -lm
+CFLAGS= -Wall -mmcu=$(DEVICE) -Os -DF_CPU=16000000 -c
+LFLAGS= -Wall -mmcu=$(DEVICE) -Os -DF_CPU=16000000 -Wl,-u,vfprintf -lprintf_flt -lm
-CFLAGS_SIM= -Wall -mmcu=$(DEVICE) -Og -DF_CPU=12000000 -g -c -c
-LFLAGS_SIM= -Wall -mmcu=$(DEVICE) -Og -DF_CPU=12000000 -g -Wl,-u,vfprintf -lprintf_flt -lm
+CFLAGS_SIM= -Wall -mmcu=$(DEVICE) -Og -DF_CPU=16000000 -g -c -c
+LFLAGS_SIM= -Wall -mmcu=$(DEVICE) -Og -DF_CPU=16000000 -g -Wl,-u,vfprintf -lprintf_flt -lm
all: dist/$(NAME).elf dist/$(NAME).s dist/$(NAME).hex sim/$(NAME).elf sim/$(NAME).s info
picocom -b 115200 --omap crlf --raise-dtr /dev/ttyUSB2
-isp-644p:
- avrdude -c usbasp -p m644p
+isp-328p:
+ avrdude -c usbasp -p m328p
-isp-flash-644p: dist/$(NAME).elf all
- avrdude -c usbasp -p m644p -e -U flash:w:$<
+isp-flash-328p: dist/$(NAME).elf all
+ avrdude -c usbasp -p m328p -e -U flash:w:$<
-flash-644p: dist/$(NAME).elf all
- avrdude -c arduino -p m644p -P /dev/ttyUSB0 -b 115200 -e -U flash:w:$<
+flash-328pp: dist/$(NAME).elf all
+ avrdude -c arduino -p m328p -P /dev/ttyUSB0 -b 115200 -e -U flash:w:$<
-isp-fuse-644p:
- avrdude -c usbasp -p m644p -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xFF:m -U lock:w:0xFF:m
+isp-fuse-328p:
+ avrdude -c usbasp -p m328p -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xFF:m -U lock:w:0xFF:m
clean:
@rm -r dist