Commit cf36849b authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Make fuses programmable with avrdude.

parent bac2e03c
......@@ -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
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment