From: Stephan Baerwolf Date: Wed, 14 Nov 2012 23:21:05 +0000 (+0000) Subject: Revert "save some more memory in case "BOOTLOADER_CAN_EXIT" is deactivated" X-Git-Tag: v0.9.1^0 X-Git-Url: http://git.linex4red.de/pub/USBaspLoader.git/commitdiff_plain/7c23f960433fd88cf0844675b1069d8086537988?ds=inline Revert "save some more memory in case "BOOTLOADER_CAN_EXIT" is deactivated" 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. --- diff --git a/firmware/bootloaderconfig.h b/firmware/bootloaderconfig.h index 7b9a4b7..0b6cea1 100644 --- a/firmware/bootloaderconfig.h +++ b/firmware/bootloaderconfig.h @@ -274,12 +274,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) diff --git a/firmware/main.c b/firmware/main.c index 3fb4902..e2bf1f6 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -41,12 +41,11 @@ #include -#include "bootloaderconfig.h" -#include "usbdrv/usbdrv.c" -#if BOOTLOADER_CAN_EXIT static void leaveBootloader() __attribute__((__noreturn__)); -#endif + +#include "bootloaderconfig.h" +#include "usbdrv/usbdrv.c" #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() @@ -201,7 +199,6 @@ static void leaveBootloader() */ nullVector(); } -#endif /* ------------------------------------------------------------------------ */ @@ -454,9 +451,7 @@ int __attribute__((noreturn)) main(void) }while (1); /* main event loop */ #endif } -#if BOOTLOADER_CAN_EXIT leaveBootloader(); -#endif } /* ------------------------------------------------------------------------ */