CONFIG_SECONDARY_PWM = 1
# default baudrate
CONFIG_SERIAL_BAUDRATE = 19200
-# check jumper for master mode
-CONFIG_MASTER_MODE = 1
# avrdude programmer protocol
PROG = usbasp
CFLAGS += -DCONFIG_SCRIPT=$(CONFIG_SCRIPT) -DCONFIG_SERIAL=$(CONFIG_SERIAL)
CFLAGS += -DCONFIG_REMOTE=$(CONFIG_REMOTE) -DCONFIG_SECONDARY_PWM=$(CONFIG_SECONDARY_PWM)
CFLAGS += -DCONFIG_SERIAL_BAUDRATE=$(CONFIG_SERIAL_BAUDRATE)
-CFLAGS += -DCONFIG_MASTER_MODE=$(CONFIG_MASTER_MODE)
####################################################
# 'make' configuration
program-%: %.hex
$(AVRDUDE) $(AVRDUDE_FLAGS) -c $(PROG) -P $(DEV) -U flash:w:$<
-program-eeprom-%: %.eep.hex
- $(AVRDUDE) $(AVRDUDE_FLAGS) -c $(PROG) -P $(DEV) -U eeprom:w:$<
+program-eeprom-%: %.eep.bincs
+ $(AVRDUDE) $(AVRDUDE_FLAGS) -c $(PROG) -P $(DEV) -U eeprom:w:$<:r
# special programming targets
%.hex: %.elf
%.eep.hex: %.elf
$(OBJCOPY) --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 -O ihex -j .eeprom $< $@
+NODEID ?= 1
+
+%.bincs: %.bin
+ ../tools/patcheeprom $(NODEID) < $< > $@
+
+%.eep.bin: %.elf
+ $(OBJCOPY) --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 -O binary -j .eeprom $< $@
+
%.lss: %.elf
$(OBJDUMP) -h -S $< > $@
-.PHONY: fuses-atmega8-fnordlichtmini-without-bootloader
+.PHONY: fuses
-fuses-atmega8-fnordlichtmini-without-bootloader:
- $(AVRDUDE) $(AVRDUDE_FLAGS) -c $(PROG) -P $(DEV) -U lfuse:w:0x3f:m -U hfuse:w:0xd9:m
+fuses:
+ $(AVRDUDE) $(AVRDUDE_FLAGS) -c $(PROG) -P $(DEV) -U lfuse:w:0x3f:m -U hfuse:w:0xd1:m
-include $(shell $(MKDIR) .dep 2>/dev/null) $(wildcard .dep/*)