2013-03-31 21:13:51 -06:00
|
|
|
PROG = main
|
|
|
|
|
2013-05-04 19:46:18 -06:00
|
|
|
MCU = attiny84
|
2013-04-01 21:17:18 -06:00
|
|
|
|
2013-03-31 21:13:51 -06:00
|
|
|
CC = avr-gcc
|
2013-04-01 21:17:18 -06:00
|
|
|
CFLAGS += -mmcu=$(MCU)
|
2013-03-31 21:13:51 -06:00
|
|
|
CFLAGS += -Os
|
|
|
|
CFLAGS += -w
|
|
|
|
|
2013-04-01 21:17:18 -06:00
|
|
|
LDFLAGS += -mmcu=$(MCU)
|
|
|
|
|
2013-05-04 19:46:18 -06:00
|
|
|
AVDFLAGS += -p $(MCU)
|
|
|
|
AVDFLAGS += -c usbtiny
|
|
|
|
|
2013-05-04 20:39:31 -06:00
|
|
|
FUSES += -U lfuse:w:0xff:m
|
2013-05-04 19:46:18 -06:00
|
|
|
FUSES += -U hfuse:w:0xd9:m
|
|
|
|
FUSES += -U efuse:w:0xff:m
|
2013-03-31 21:13:51 -06:00
|
|
|
|
|
|
|
|
|
|
|
upload: .upload
|
|
|
|
|
|
|
|
.upload: $(PROG).hex
|
|
|
|
avrdude $(AVDFLAGS) -U flash:w:$<
|
|
|
|
touch $@
|
|
|
|
|
2013-05-04 19:46:18 -06:00
|
|
|
fuses:
|
|
|
|
avrdude $(AVDFLAGS) $(FUSES)
|
|
|
|
|
2013-03-31 21:13:51 -06:00
|
|
|
$(PROG).hex: $(PROG)
|
|
|
|
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature $< $@
|
|
|
|
|
|
|
|
main: main.o avr.o
|
|
|
|
|
2013-04-01 21:17:18 -06:00
|
|
|
#main.o: avr.h
|
|
|
|
#avr.o: avr.h
|
|
|
|
|
2013-03-31 21:13:51 -06:00
|
|
|
clean:
|
2013-04-01 21:17:18 -06:00
|
|
|
rm -f $(PROG) *.o *.hex .upload
|
2013-03-31 21:13:51 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-30 14:19:41 -06:00
|
|
|
|