-
Notifications
You must be signed in to change notification settings - Fork 16
/
makefile
30 lines (26 loc) · 887 Bytes
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
MCU=attiny85
AVRDUDEMCU=t85
CPU_SPEED=-DF_CPU=8000000UL
CC=/usr/bin/avr-gcc
CFLAGS=-g -Os -Wall -w -mcall-prologues -mmcu=$(MCU) $(CPU_SPEED)
OBJ2HEX=/usr/bin/avr-objcopy
AVRDUDE=/usr/local/bin/avrdude
TARGET=MagSpoofPI
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