diff --git a/Makefile b/Makefile index 194889d8c7..ca9c5999ed 100644 --- a/Makefile +++ b/Makefile @@ -106,6 +106,26 @@ visu3d: lib wind: cd $(WIND); $(MAKE) +wr_fuses_ap: + cd $(AIRBORNE); make TARGET=ap wr_fuses + +wr_fuses_fbw: + cd $(AIRBORNE); make TARGET=fbw wr_fuses + + +rd_fuses_ap: + cd $(AIRBORNE); make TARGET=ap rd_fuses + +rd_fuses_fbw: + cd $(AIRBORNE); make TARGET=fbw rd_fuses + + +check_fuses_ap: + cd $(AIRBORNE); make TARGET=ap check_fuses + +check_fuses_fbw: + cd $(AIRBORNE); make TARGET=fbw check_fuses + static_h : PAPARAZZI_HOME=`pwd` PAPARAZZI_SRC=`pwd` make -f Makefile.gen diff --git a/conf/Makefile.avr b/conf/Makefile.avr index 4c0d5f7fad..236427676c 100644 --- a/conf/Makefile.avr +++ b/conf/Makefile.avr @@ -92,17 +92,17 @@ rd_fuses: check_arch $(UISP) $(ISP_FLAGS) --rd_fuses wr_fuses : check_arch - $(UISP) $(ISP_FLAGS) --wr_fuse_h=$(HIGH_FUSE) - $(UISP) $(ISP_FLAGS) --wr_fuse_l=$(LOW_FUSE) - $(UISP) $(ISP_FLAGS) --wr_fuse_e=$(EXT_FUSE) - $(UISP) $(ISP_FLAGS) --wr_lock=$(LOCK_FUSE) + $(UISP) $(ISP_FLAGS) --wr_fuse_h=$($(TARGET).HIGH_FUSE) + $(UISP) $(ISP_FLAGS) --wr_fuse_l=$($(TARGET).LOW_FUSE) + $(UISP) $(ISP_FLAGS) --wr_fuse_e=$($(TARGET).EXT_FUSE) + $(UISP) $(ISP_FLAGS) --wr_lock=$($(TARGET).LOCK_FUSE) TMPFILE = '/tmp/check_fuses.tmp' check_fuses: check_arch @echo "##### Check of fuses #####" @$(UISP) $(ISP_FLAGS) --rd_fuses >$(TMPFILE) - @if (grep -i 'Fuse Low Byte' $(TMPFILE) | cut -c24- | grep -iq $(LOW_FUSE)) && (grep -i 'Fuse High Byte' $(TMPFILE) |cut -c24- | grep -iq $(HIGH_FUSE)) && (grep -i 'Fuse Extended Byte' $(TMPFILE) |cut -c24- | grep -iq $(EXT_FUSE)) && (grep -i 'Lock Bits' $(TMPFILE) |cut -c24- | grep -iq $(LOCK_FUSE)); then echo "-> Fuses are Ok"; rm $(TMPFILE); else echo "-> Wrong fuses. Type 'make wr_fuses'"; rm $(TMPFILE); exit 1; fi + @if (grep -i 'Fuse Low Byte' $(TMPFILE) | cut -c24- | grep -iq $($(TARGET).LOW_FUSE)) && (grep -i 'Fuse High Byte' $(TMPFILE) |cut -c24- | grep -iq $($(TARGET).HIGH_FUSE)) && (grep -i 'Fuse Extended Byte' $(TMPFILE) |cut -c24- | grep -iq $($(TARGET).EXT_FUSE)) && (grep -i 'Lock Bits' $(TMPFILE) |cut -c24- | grep -iq $($(TARGET).LOCK_FUSE)); then echo "-> Fuses are Ok"; rm $(TMPFILE); else echo "-> Wrong fuses. Type 'make wr_fuses'"; rm $(TMPFILE); exit 1; fi