2013-06-30 14:57:44 -06:00
|
|
|
PROG = main
|
2013-03-27 22:47:17 -06:00
|
|
|
|
2013-06-30 14:57:44 -06:00
|
|
|
MCU = attiny84
|
2013-05-04 19:46:18 -06:00
|
|
|
|
2013-06-30 14:57:44 -06:00
|
|
|
CC = avr-gcc
|
|
|
|
CFLAGS += -mmcu=$(MCU)
|
|
|
|
CFLAGS += -Os
|
|
|
|
CFLAGS += -w
|
2013-03-07 23:55:05 -07:00
|
|
|
|
2013-06-30 14:57:44 -06:00
|
|
|
LDFLAGS += -mmcu=$(MCU)
|
|
|
|
|
|
|
|
AVDFLAGS += -p $(MCU)
|
|
|
|
AVDFLAGS += -c usbtiny
|
|
|
|
|
|
|
|
CLOCK_HZ = 16000000
|
|
|
|
FUSES += -U lfuse:w:0xff:m
|
|
|
|
FUSES += -U hfuse:w:0xd9:m
|
|
|
|
FUSES += -U efuse:w:0xff:m
|
|
|
|
|
|
|
|
|
|
|
|
upload: .upload
|
|
|
|
|
|
|
|
.upload: $(PROG).hex
|
|
|
|
avrdude $(AVDFLAGS) -U flash:w:$<
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
fuses:
|
|
|
|
avrdude $(AVDFLAGS) $(FUSES)
|
|
|
|
|
|
|
|
main: main.o avr.o
|
|
|
|
|
|
|
|
$(PROG).hex: $(PROG)
|
|
|
|
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature $< $@
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(PROG) *.o *.hex .upload
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|