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
|
|
|
|
|
2013-07-02 19:54:39 -06:00
|
|
|
FUSES += -U lfuse:w:0x7f:m
|
|
|
|
FUSES += -U hfuse:w:0xdd:m
|
2013-06-30 14:57:44 -06:00
|
|
|
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
|
2014-01-11 21:02:24 -07:00
|
|
|
|
|
|
|
avr.o: avr.c config.h
|
2013-06-30 14:57:44 -06:00
|
|
|
|
|
|
|
$(PROG).hex: $(PROG)
|
|
|
|
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature $< $@
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(PROG) *.o *.hex .upload
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|