# Default options. # ===================================================================== # You can create a config.mk to override the defaults. -include config.mk # # Programmer used for In System Programming ISP_PROG ?= dapa # device the ISP programmer is connected to ISP_DEV ?= /dev/parport0 # Programmer used for serial programming # (using the bootloader) SERIAL_PROG ?= butterfly # device the serial programmer is connected to SERIAL_DEV ?= /dev/ttyUSB0 # I2C-Address # Bit 0 is General Call enable, address are bits 1-7 I2C_ADDR ?= 0x02 # Targets # ===================================================================== all: fnordlicht.hex serial2i2c.hex ci: clean install-fnordlicht di: AFLAGS=--define SERIALDEBUG=1 di: ci dir: AFLAGS=--define SERIALDEBUG=1 --define IR_DECODER=1 dir: ci did: AFLAGS=--define SERIALDEBUG=1 --define DEVELBOARD=1 did: ci dii: AFLAGS=--define IR_DECODER=1 --define IR_DEBUG=1 dii: ci clean: rm -f *.hex *.list *.map *.obj *.cof install-bootloader: prog-isp-bootloader install-fnordlicht: prog-serial-fnordlicht install-serial2i2c: prog-serial-serial2i2c i2c-addr: start-bootloader avrdude -p m8 -c $(SERIAL_PROG) -P $(SERIAL_DEV) -U e:w:$(I2C_ADDR):m fuse: avrdude -p m8 -c $(ISP_PROG) -P $(ISP_DEV) -U hfuse:w:0xD0:m avrdude -p m8 -c $(ISP_PROG) -P $(ISP_DEV) -U lfuse:w:0xE0:m interactive-isp: avrdude -p m8 -c $(ISP_PROG) -P $(ISP_DEV) -t interactive-serial: avrdude -p m8 -c $(SERIAL_PROG) -P $(SERIAL_DEV) -t start-bootloader: echo 'x' > $(SERIAL_DEV) stop-bootloader: echo 'X' > $(SERIAL_DEV) prog-isp-%: %.hex avrdude -p m8 -c $(ISP_PROG) -P $(ISP_DEV) -U f:w:$< prog-serial-%: %.hex start-bootloader avrdude -p m8 -c $(SERIAL_PROG) -P $(SERIAL_DEV) -U f:w:$< bootloader.hex: cd boot/v0_7 && make clean && make cp boot/v0_7/main.hex bootloader.hex fnordlicht.hex: fnordlicht.asm *.inc avra --max_errors 1 $(AFLAGS) $< serial2i2c.hex: serial2i2c.asm fifo_handling.inc avra --max_errors 1 $(AFLAGS) $< bootstrap: fuse install-bootloader install-fnordlicht i2c-addr sleep 2 && echo X > $(SERIAL_DEV)