ioc: avr: Add make rfu command to AVR Makefiles

This commit is contained in:
Markus Koch 2019-12-27 22:41:17 +01:00
parent 0da970d40f
commit 7269db9e0a
2 changed files with 10 additions and 2 deletions

View File

@ -3,7 +3,7 @@ PDEV=/dev/ttyUSB1
CFLAGS=-g -Wall -mcall-prologues -mmcu=$(MCU) -Os -DF_CPU=8000000 CFLAGS=-g -Wall -mcall-prologues -mmcu=$(MCU) -Os -DF_CPU=8000000
LDFLAGS=-Wl,-gc-sections -Wl,-relax LDFLAGS=-Wl,-gc-sections -Wl,-relax
CC=avr-gcc CC=avr-gcc
TARGET=main TARGET=fw_keyboard
OBJECT_FILES=main.o OBJECT_FILES=main.o
all: $(TARGET).hex all: $(TARGET).hex
@ -17,6 +17,10 @@ clean:
%.obj: $(OBJECT_FILES) %.obj: $(OBJECT_FILES)
$(CC) $(CFLAGS) $(OBJECT_FILES) $(LDFLAGS) -o $@ $(CC) $(CFLAGS) $(OBJECT_FILES) $(LDFLAGS) -o $@
rfu: $(TARGET).hex
scp $< markus@opi:/home/markus/projects/lw35/deploy/
ssh root@opi 'lw35-tool set-mode rfu-kbd; avrdude -p atmega8 -P /dev/lw35 -c arduino -b 19200 -U flash:w:/home/markus/projects/lw35/deploy/$<'
program: $(TARGET).hex program: $(TARGET).hex
avrdude -p $(MCU) -P $(PDEV) -c arduino -b 19200 -U flash:w:$(TARGET).hex avrdude -p $(MCU) -P $(PDEV) -c arduino -b 19200 -U flash:w:$(TARGET).hex

View File

@ -3,7 +3,7 @@ PDEV=/dev/ttyUSB0
CFLAGS=-g -Wall -mcall-prologues -mmcu=$(MCU) -O2 -DF_CPU=16000000 CFLAGS=-g -Wall -mcall-prologues -mmcu=$(MCU) -O2 -DF_CPU=16000000
LDFLAGS=-Wl,-gc-sections -Wl,-relax LDFLAGS=-Wl,-gc-sections -Wl,-relax
CC=avr-gcc CC=avr-gcc
TARGET=main TARGET=fw_printer
OBJECT_FILES=main.o OBJECT_FILES=main.o
all: $(TARGET).hex all: $(TARGET).hex
@ -18,6 +18,10 @@ clean:
$(CC) $(CFLAGS) $(OBJECT_FILES) $(LDFLAGS) -o $@ $(CC) $(CFLAGS) $(OBJECT_FILES) $(LDFLAGS) -o $@
avr-size -C --mcu=atmega8 main.obj avr-size -C --mcu=atmega8 main.obj
rfu: $(TARGET).hex
scp $< markus@opi:/home/markus/projects/lw35/deploy/
ssh root@opi 'lw35-tool set-mode rfu-pri; avrdude -p atmega8 -P /dev/lw35 -c arduino -b 19200 -U flash:w:/home/markus/projects/lw35/deploy/$<'
program: $(TARGET).obj program: $(TARGET).obj
avrdude -p $(MCU) -P $(PDEV) -c arduino -b 19200 -U flash:w:$(TARGET).hex avrdude -p $(MCU) -P $(PDEV) -c arduino -b 19200 -U flash:w:$(TARGET).hex