diff --git a/lib/avr/Makefile.common b/lib/avr/Makefile.common index aa15db4feaed0c2848036428ab7c1b623360ad87..cc9828b9fde5dfdbe8c035d192164289b81f213e 100644 --- a/lib/avr/Makefile.common +++ b/lib/avr/Makefile.common @@ -68,6 +68,15 @@ OBJECTS=$($(1).C:%=compiled/$(1)/%.o) -U flash:w:compiled/$(TARGET)/$*.sr:s %.FUSE: + [ -n "$($(TARGET).FUSE_L)" ] && avrdude -P usb -c avrisp2 -p $(CHIP) \ + -U lfuse:w:$($(TARGET).FUSE_L):m || true + [ -n "$($(TARGET).FUSE_H)" ] && avrdude -P usb -c avrisp2 -p $(CHIP) \ + -U hfuse:w:$($(TARGET).FUSE_H):m || true + [ -n "$($(TARGET).FUSE_E)" ] && avrdude -P usb -c avrisp2 -p $(CHIP) \ + -U efuse:w:$($(TARGET).FUSE_E):m || true + +%.FUSE_uisp: + exit 1 uisp \ -dprog=stk200 \ $($(TARGET).FUSE) @@ -85,4 +94,4 @@ compiled/$(TARGET)/%.sr: compiled/$(TARGET)/%.exe compiled/$(TARGET)/%.exe \ compiled/$(TARGET)/%.sr -endif \ No newline at end of file +endif diff --git a/linear_pendulum_2009/avr/Makefile b/linear_pendulum_2009/avr/Makefile index dc03524ae66cd678dffeae62954e6f98c3098d85..8367fac1af5345be6373a6c6b813d281a9a39f89 100644 --- a/linear_pendulum_2009/avr/Makefile +++ b/linear_pendulum_2009/avr/Makefile @@ -3,13 +3,15 @@ TARGETS=current_control vel_control current_control.ARCH=avr current_control.CHIP=atmega16 # 14.7456 MHz crystal, brown out -current_control.FUSE=--wr_fuse_l=0x1f --wr_fuse_h=0xd9 --wr_fuse_e=0xff +vel_control.FUSE_L=0x1f +vel_control.FUSE_H=0xd9 current_control.C=current_control vel_control.ARCH=avr vel_control.CHIP=atmega16 # 14.7456 MHz crystal, brown out -vel_control.FUSE=--wr_fuse_l=0x1f --wr_fuse_h=0xd9 --wr_fuse_e=0xff +vel_control.FUSE_L=0x1f +vel_control.FUSE_H=0xd9 vel_control.C=vel_control vel_control.H=serialio_core