From ace61d757e0c580365adfcd8464c28ca9f98f878 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sat, 6 Apr 2013 14:34:57 +0000 Subject: Add checks to the bootloaders so that they will give a user-friendly compile error if not compiled with size optimizations. --- Bootloaders/DFU/BootloaderDFU.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Bootloaders/DFU/BootloaderDFU.h') diff --git a/Bootloaders/DFU/BootloaderDFU.h b/Bootloaders/DFU/BootloaderDFU.h index 5223e47eb..537902393 100644 --- a/Bootloaders/DFU/BootloaderDFU.h +++ b/Bootloaders/DFU/BootloaderDFU.h @@ -54,13 +54,18 @@ #include #include + /* Preprocessor Checks: */ + #if !defined(__OPTIMIZE_SIZE__) + #error This bootloader requires that it be compiled for size, not speed for it to fit into the target device. + #endif + /* Macros: */ /** Major bootloader version number. */ #define BOOTLOADER_VERSION_MINOR 2 /** Minor bootloader version number. */ #define BOOTLOADER_VERSION_REV 0 - + /** Magic bootloader key to unlock forced application start mode. */ #define MAGIC_BOOT_KEY 0xDC42 @@ -203,7 +208,7 @@ static void ProcessWriteCommand(void); static void ProcessReadCommand(void); #endif - + void Application_Jump_Check(void) ATTR_INIT_SECTION(3); #endif -- cgit v1.2.3