1
0
mirror of https://github.com/binary-kitchen/doorlockd synced 2024-12-22 10:24:26 +01:00

avr: Add fuse rule to Makefile

Signed-off-by: Ralf Ramsauer <ralf@binary-kitchen.de>
This commit is contained in:
Ralf Ramsauer 2018-09-26 23:40:37 +02:00
parent 6370e54ff8
commit 8623d3a78a

View File

@ -16,6 +16,10 @@ F_OSC ?= 4000000
UART_BAUD ?= 9600 UART_BAUD ?= 9600
AVRDUDE_MCU ?= t2313 AVRDUDE_MCU ?= t2313
PROGRAMMER=linuxspi
PORT=/dev/spidev0.0:/dev/gpiochip0:25
SPEED=125000
OBJS = main.o uart.o OBJS = main.o uart.o
CC = avr-gcc CC = avr-gcc
@ -35,7 +39,10 @@ $(TARGET).hex: $(TARGET).elf
$(OBJCOPY) -O ihex -R .eeprom $^ $@ $(OBJCOPY) -O ihex -R .eeprom $^ $@
program: $(TARGET).hex program: $(TARGET).hex
$(AVRDUDE) -p $(AVRDUDE_MCU) -c linuxspi -P /dev/spidev0.0:/dev/gpiochip0:25 -U flash:w:$^ $(AVRDUDE) -p $(AVRDUDE_MCU) -c $(PROGRAMMER) -P $(PORT) -U flash:w:$^
fuse:
$(AVRDUDE) -p $(AVRDUDE_MCU) -c $(PROGRAMMER) -P $(PORT) -b $(SPEED) -U lfuse:w:0xfd:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m
clean: clean:
rm -f $(OBJS) rm -f $(OBJS)