BUG: fix flash read error on atmegas with more than 64k memory
[pub/USBaspLoader.git] / firmware / bootloaderconfig.h
index 991b9d0..4f3f613 100644 (file)
@@ -12,6 +12,7 @@
 
 #ifndef __bootloaderconfig_h_included__
 #define __bootloaderconfig_h_included__
+#include <avr/io.h>
 
 /*
 General Description:
@@ -143,6 +144,14 @@ these macros are defined, the boot loader usees them.
  * feature.
  */
 
+#define HAVE_SPMINTEREFACE_NORETMAGIC  1
+/*
+ * If sth. went wrong within "bootloader__do_spm" and this macro is ACTIVATED,
+ * then "bootloader__do_spm" will not return the call and loop infinity instead.
+ * 
+ * This feature prevents old updaters to do sth. undefined on wrong magic.
+ */
+
 /* all boards should use a magic to make it safe to confuse updatefiles :-)  */
 #define HAVE_SPMINTEREFACE_MAGICVALUE    0
 /* If this feature is enabled (value != 0), the configured 32bit value is 
@@ -266,12 +275,10 @@ static inline void  bootLoaderInit(void)
     MCUCSR = 0;                     /* clear all reset flags for next time */
 }
 
-#if BOOTLOADER_CAN_EXIT
 static inline void  bootLoaderExit(void)
 {
     PIN_PORT(JUMPER_PORT) = 0;         /* undo bootLoaderInit() changes */
 }
-#endif
 
 #define bootLoaderCondition()          ((PIN_PIN(JUMPER_PORT) & (1 << PIN(JUMPER_PORT, JUMPER_BIT))) == 0)