2018-05-12 20:29:50 +02:00
|
|
|
MCU=atmega8
|
2019-11-10 18:11:09 +01:00
|
|
|
PDEV=/dev/ttyUSB0
|
|
|
|
CFLAGS=-g -Wall -mcall-prologues -mmcu=$(MCU) -O2 -DF_CPU=16000000
|
2018-05-12 20:29:50 +02:00
|
|
|
LDFLAGS=-Wl,-gc-sections -Wl,-relax
|
|
|
|
CC=avr-gcc
|
2019-12-27 22:41:17 +01:00
|
|
|
TARGET=fw_printer
|
2018-05-12 20:29:50 +02:00
|
|
|
OBJECT_FILES=main.o
|
|
|
|
|
|
|
|
all: $(TARGET).hex
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f *.o *.hex *.obj *.hex
|
|
|
|
|
|
|
|
%.hex: %.obj
|
|
|
|
avr-objcopy -R .eeprom -O ihex $< $@
|
|
|
|
|
|
|
|
%.obj: $(OBJECT_FILES)
|
|
|
|
$(CC) $(CFLAGS) $(OBJECT_FILES) $(LDFLAGS) -o $@
|
2019-10-26 17:11:07 +02:00
|
|
|
avr-size -C --mcu=atmega8 main.obj
|
2018-05-12 20:29:50 +02:00
|
|
|
|
2019-12-27 22:41:17 +01:00
|
|
|
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/$<'
|
|
|
|
|
2018-05-12 20:29:50 +02:00
|
|
|
program: $(TARGET).obj
|
2019-11-10 18:11:09 +01:00
|
|
|
avrdude -p $(MCU) -P $(PDEV) -c arduino -b 19200 -U flash:w:$(TARGET).hex
|
2018-05-12 20:29:50 +02:00
|
|
|
|
|
|
|
fuse:
|
|
|
|
avrdude -p m8 -c usbasp -U lfuse:w:0xe4:m -U hfuse:w:0xd9:m
|
|
|
|
|
|
|
|
.phony: program fuse
|