Commit 35570f3d authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Enable running from top level directory

parent a5f94afc
*/avr/compiled */avr/compiled
\ No newline at end of file *~
\ No newline at end of file
all:
@echo "Do 'make PROCESS.LOAD' or 'make PROCESS.FUSE'" >&2
@echo "where PROCESS is one of" >&2
@for m in */*/Makefile ; do \
echo " $$(dirname $$(dirname $$m))" >&2 \
; done
@echo >&2
@exit 1
%.LOAD:
make -C $*/avr $@
%.FUSE:
make -C $*/avr $@
Software for processes used at Department of Automatic Control Software for processes used at Department of Automatic Control
============================================================== ==============================================================
batch-2002
How to (re)program a chip
=========================
Clone this repository and change to the top level directory, then
* If it's the first time this chip is programmed, the fuse bits
need to be programmed, this is done by running `make PROCESS_NAME.FUSE`
* Program the chip by running `make PROCESS_NAME.LOAD`
...@@ -68,12 +68,27 @@ OBJECTS=$($(1).C:%=compiled/$(1)/%.o) ...@@ -68,12 +68,27 @@ OBJECTS=$($(1).C:%=compiled/$(1)/%.o)
-U flash:w:compiled/$(TARGET)/$*.sr:s -U flash:w:compiled/$(TARGET)/$*.sr:s
%.FUSE: %.FUSE:
[ -n "$($(TARGET).FUSE_L)" ] && avrdude -P usb -c avrisp2 -p $(CHIP) \ @if [ -n "$($(TARGET).FUSE_L)" ] ; then \
-U lfuse:w:$($(TARGET).FUSE_L):m || true echo avrdude -P usb -c avrisp2 -p $(CHIP) \
[ -n "$($(TARGET).FUSE_H)" ] && avrdude -P usb -c avrisp2 -p $(CHIP) \ -U lfuse:w:$($(TARGET).FUSE_L):m >&2 \
-U hfuse:w:$($(TARGET).FUSE_H):m || true ; avrdude -qq -P usb -c avrisp2 -p $(CHIP) \
[ -n "$($(TARGET).FUSE_E)" ] && avrdude -P usb -c avrisp2 -p $(CHIP) \ -U lfuse:w:$($(TARGET).FUSE_L):m \
-U efuse:w:$($(TARGET).FUSE_E):m || true || (echo "failed to program FUSE_L with $($(TARGET).FUSE_L)" >&2 && exit 1) \
; fi
@if [ -n "$($(TARGET).FUSE_H)" ] ; then \
echo avrdude -P usb -c avrisp2 -p $(CHIP) \
-U hfuse:w:$($(TARGET).FUSE_H):m >&2 \
; avrdude -qq -P usb -c avrisp2 -p $(CHIP) \
-U hfuse:w:$($(TARGET).FUSE_H):m \
|| (echo "failed to program FUSE_H with $($(TARGET).FUSE_H)" >&2 && exit 1) \
; fi
@if [ -n "$($(TARGET).FUSE_E)" ] ; then \
echo avrdude -P usb -c avrisp2 -p $(CHIP) \
-U efuse:w:$($(TARGET).FUSE_E):m >&2 \
; avrdude -qq -P usb -c avrisp2 -p $(CHIP) \
-U efuse:w:$($(TARGET).FUSE_E):m \
|| (echo "failed to program FUSE_E with $($(TARGET).FUSE_E)" >&2 && exit 1) \
; fi
%.FUSE_uisp: %.FUSE_uisp:
exit 1 exit 1
......
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