Revert "save some more memory in case "BOOTLOADER_CAN_EXIT" is deactivated" v0.9.1
authorStephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
Wed, 14 Nov 2012 23:21:05 +0000 (23:21 +0000)
committerStephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
Wed, 14 Nov 2012 23:21:05 +0000 (23:21 +0000)
This patch make the bootloader unable to execute any user-flashed firmware.
Because "BOOTLOADER_CAN_EXIT" is an essential feature for smaller MCUs,
this patch will be reverted instantly.

New version is v0.9.1 - checksums of precompiles stay the same

Sorry for the inconvenience,

Stephan Baerwolf (stephan.baerwolf@tu-ilmenau.de)

This reverts commit 2ca9a19cd19c152ec45d920994a4c64c94d4b3f5.

firmware/bootloaderconfig.h
firmware/main.c

index 7b9a4b7..0b6cea1 100644 (file)
@@ -274,12 +274,10 @@ static inline void  bootLoaderInit(void)
     MCUCSR = 0;                     /* clear all reset flags for next time */
 }
 
     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 */
 }
 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)
 
 
 #define bootLoaderCondition()          ((PIN_PIN(JUMPER_PORT) & (1 << PIN(JUMPER_PORT, JUMPER_BIT))) == 0)
 
index 3fb4902..e2bf1f6 100644 (file)
 #include <string.h>
 
 
 #include <string.h>
 
 
-#include "bootloaderconfig.h"
-#include "usbdrv/usbdrv.c"
 
 
-#if BOOTLOADER_CAN_EXIT
 static void leaveBootloader() __attribute__((__noreturn__));
 static void leaveBootloader() __attribute__((__noreturn__));
-#endif
+
+#include "bootloaderconfig.h"
+#include "usbdrv/usbdrv.c"
 
 #ifndef BOOTLOADER_ADDRESS
   #error need to know the bootloaders flash address!
 
 #ifndef BOOTLOADER_ADDRESS
   #error need to know the bootloaders flash address!
@@ -180,7 +179,6 @@ static const uchar  signatureBytes[4] = {
 
 /* ------------------------------------------------------------------------ */
 
 
 /* ------------------------------------------------------------------------ */
 
-#if BOOTLOADER_CAN_EXIT
 static void (*nullVector)(void) __attribute__((__noreturn__));
 
 static void leaveBootloader()
 static void (*nullVector)(void) __attribute__((__noreturn__));
 
 static void leaveBootloader()
@@ -201,7 +199,6 @@ static void leaveBootloader()
  */
     nullVector();
 }
  */
     nullVector();
 }
-#endif
 
 /* ------------------------------------------------------------------------ */
 
 
 /* ------------------------------------------------------------------------ */
 
@@ -454,9 +451,7 @@ int __attribute__((noreturn)) main(void)
         }while (1);            /* main event loop */
 #endif
     }
         }while (1);            /* main event loop */
 #endif
     }
-#if BOOTLOADER_CAN_EXIT
     leaveBootloader();
     leaveBootloader();
-#endif
 }
 
 /* ------------------------------------------------------------------------ */
 }
 
 /* ------------------------------------------------------------------------ */