all : test.hex burn test.lst PART=attiny441 PROGPART=t441 AVRP=~/cpptest/avr-toolchain/avr-toolchain/bin/avr- CFLAGS=-g -Wall -Os -mmcu=$(PART) -DF_CPU=20000000UL ASFLAGS:=$(CFLAGS) CC=avr-gcc huetabler.h : huetabler.c gcc -o huetabler huetabler.c -lm ./huetabler > huetabler.h test.hex : test.elf $(AVRP)objcopy -j .text -j .data -O ihex test.elf test.hex test.elf : test.c huetabler.h $(AVRP)gcc -I -g $(CFLAGS) -mmcu=$(PART) -Wl,-Map,test.map -o $@ test.c -L/usr/lib/binutils/avr/2.18 test.lst : test.c huetabler.h $(AVRP)gcc -c -g -Wa,-a,-ad $(CFLAGS) test.c > $@ burn : test.hex sudo avrdude -c usbtiny -p $(PROGPART) -V -U flash:w:test.hex #For PLL burnfuses : sudo avrdude -c usbtiny -p $(PROGPART) -U lfuse:w:0xE2:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m burnfuses_default : sudo avrdude -c usbtiny -p $(PROGPART) -U lfuse:w:0x62:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m readfuses : sudo avrdude -c usbtiny -p $(PROGPART) -U hfuse:r:high.txt:b -U lfuse:r:low.txt:b clean : rm -f *~ high.txt low.txt test.hex test.map test.elf *.o sendpack.S makesendpack