have updater check HAVE_SPMINTEREFACE and raise error if not supported
authorStephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
Sat, 10 Nov 2012 10:15:21 +0000 (11:15 +0100)
committerStephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
Sat, 10 Nov 2012 11:27:27 +0000 (11:27 +0000)
Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
firmware/Makefile
updater/Makefile
updater/updater.c

index 6808086..094fc2f 100644 (file)
@@ -70,7 +70,7 @@ clean:
        $(RM) usbdrv/usbdrv.s
 
 # file targets:
        $(RM) usbdrv/usbdrv.s
 
 # file targets:
-main.bin:      $(OBJECTS)
+main.bin:      $(OBJECTS) bootloaderconfig.h
        $(CC) $(CFLAGS) -o main.bin $(OBJECTS) $(LDFLAGS)
 
 main.hex:      main.bin
        $(CC) $(CFLAGS) -o main.bin $(OBJECTS) $(LDFLAGS)
 
 main.hex:      main.bin
index a3aa145..475d664 100644 (file)
@@ -40,7 +40,7 @@ all:  updater.hex
        $(MAKE) -C ../firmware main.hex
 
 
        $(MAKE) -C ../firmware main.hex
 
 
-usbasploader.raw:
+usbasploader.raw: ../firmware/main.bin
        $(OBC) -j .text -j .data -O binary ../firmware/main.bin usbasploader.raw
 
 usbasploader.o: usbasploader.raw
        $(OBC) -j .text -j .data -O binary ../firmware/main.bin usbasploader.raw
 
 usbasploader.o: usbasploader.raw
@@ -57,6 +57,7 @@ updater.elf: updater.o usbasploader.o
 updater.hex: updater.elf
        $(OBC) -j .text -j .data -O ihex updater.elf updater.hex
        $(ECHO) "."
 updater.hex: updater.elf
        $(OBC) -j .text -j .data -O ihex updater.elf updater.hex
        $(ECHO) "."
+       $(ECHO) "."
        $(SIZ) updater.elf
        $(ECHO) "."
        $(AVRDUDE) -D -U flash:w:updater.hex:i
        $(SIZ) updater.elf
        $(ECHO) "."
        $(AVRDUDE) -D -U flash:w:updater.hex:i
@@ -67,8 +68,9 @@ deepclean: clean
        $(RM) *~
 
 clean:
        $(RM) *~
 
 clean:
-       $(RM) *.o
-       $(RM) *.raw
+       $(RM) usbasploader.o
+       $(RM) updater.o
+       $(RM) usbasploader.raw
        $(RM) updater.hex
        $(RM) updater.elf
        $(RM) usbasploader.raw
\ No newline at end of file
        $(RM) updater.hex
        $(RM) updater.elf
        $(RM) usbasploader.raw
\ No newline at end of file
index c1ff17d..559ce66 100644 (file)
 #include <util/delay.h>
 #include <string.h>
 
 #include <util/delay.h>
 #include <string.h>
 
-
+#include "../firmware/bootloaderconfig.h"
+#if !HAVE_SPMINTEREFACE
+  #error "bootloader does not support updating itself! (HAVE_SPMINTEREFACE)"
+#endif
 
 // helpful definitions and makros ////
 
 
 // helpful definitions and makros ////