Created
April 9, 2015 17:00
-
-
Save paulbarber/79f947131fa6a84797fe to your computer and use it in GitHub Desktop.
makefile for blinky.c for atTiny85
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MCU=attiny85 | |
AVRDUDEMCU=t85 | |
CC=/usr/bin/avr-gcc | |
CFLAGS=-g -Os -Wall -mcall-prologues -mmcu=$(MCU) | |
OBJ2HEX=/usr/bin/avr-objcopy | |
AVRDUDE=/usr/local/bin/avrdude | |
TARGET=blinky | |
all : | |
$(CC) $(CFLAGS) $(TARGET).c -o $(TARGET) | |
$(OBJ2HEX) -R .eeprom -O ihex $(TARGET) $(TARGET).hex | |
rm -f $(TARGET) | |
install : all | |
sudo gpio -g mode 22 out | |
sudo gpio -g write 22 0 | |
sudo $(AVRDUDE) -p $(AVRDUDEMCU) -P /dev/spidev0.0 -c linuxspi -b 10000 -U flash:w:$(TARGET).hex | |
sudo gpio -g write 22 1 | |
noreset : all | |
sudo $(AVRDUDE) -p $(AVRDUDEMCU) -P /dev/spidev0.0 -c linuxspi -b 10000 -U flash:w:$(TARGET).hex | |
fuse : | |
sudo gpio -g mode 22 out | |
sudo gpio -g write 22 0 | |
sudo $(AVRDUDE) -p $(AVRDUDEMCU) -P /dev/spidev0.0 -c linuxspi -b 10000 -U lfuse:w:0x62:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m | |
sudo gpio -g write 22 1 | |
clean : | |
rm -f *.hex *.obj *.o |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment