Fix documentation: jump address for bootloader should be words, not bytes.
[pub/USBasp.git] / Bootloaders / DFU / BootloaderDFU.h
index 5223e47..5efcce3 100644 (file)
@@ -1,13 +1,13 @@
 /*
              LUFA Library
 /*
              LUFA Library
-     Copyright (C) Dean Camera, 2013.
+     Copyright (C) Dean Camera, 2014.
 
   dean [at] fourwalledcubicle [dot] com
            www.lufa-lib.org
 */
 
 /*
 
   dean [at] fourwalledcubicle [dot] com
            www.lufa-lib.org
 */
 
 /*
-  Copyright 2013  Dean Camera (dean [at] fourwalledcubicle [dot] com)
+  Copyright 2014  Dean Camera (dean [at] fourwalledcubicle [dot] com)
 
   Permission to use, copy, modify, distribute, and sell this
   software and its documentation for any purpose is hereby granted
 
   Permission to use, copy, modify, distribute, and sell this
   software and its documentation for any purpose is hereby granted
 
                #include <LUFA/Drivers/USB/USB.h>
                #include <LUFA/Drivers/Board/LEDs.h>
 
                #include <LUFA/Drivers/USB/USB.h>
                #include <LUFA/Drivers/Board/LEDs.h>
+               #include <LUFA/Platform/Platform.h>
+
+       /* Preprocessor Checks: */
+               #if !defined(__OPTIMIZE_SIZE__)
+                       #error This bootloader requires that it be optimized for size, not speed, to fit into the target device. Change optimization settings and try again.
+               #endif
 
        /* Macros: */
                /** Major bootloader version number. */
 
        /* Macros: */
                /** Major bootloader version number. */
@@ -60,7 +66,7 @@
 
                /** Minor bootloader version number. */
                #define BOOTLOADER_VERSION_REV   0
 
                /** Minor bootloader version number. */
                #define BOOTLOADER_VERSION_REV   0
-               
+
                /** Magic bootloader key to unlock forced application start mode. */
                #define MAGIC_BOOT_KEY            0xDC42
 
                /** Magic bootloader key to unlock forced application start mode. */
                #define MAGIC_BOOT_KEY            0xDC42
 
                        dfuMANIFEST                  = 7,
                        dfuMANIFEST_WAIT_RESET       = 8,
                        dfuUPLOAD_IDLE               = 9,
                        dfuMANIFEST                  = 7,
                        dfuMANIFEST_WAIT_RESET       = 8,
                        dfuUPLOAD_IDLE               = 9,
-                       dfuERROR                         = 10
+                       dfuERROR                     = 10
                };
 
                /** DFU command status error codes. Refer to the DFU class specification for information on each error code. */
                };
 
                /** DFU command status error codes. Refer to the DFU class specification for information on each error code. */
                        errUSBR                      = 12,
                        errPOR                       = 13,
                        errUNKNOWN                   = 14,
                        errUSBR                      = 12,
                        errPOR                       = 13,
                        errUNKNOWN                   = 14,
-                       errSTALLEDPKT                = 15
+                       errSTALLEDPKT                = 15
                };
 
        /* Function Prototypes: */
                };
 
        /* Function Prototypes: */
                        static void ProcessWriteCommand(void);
                        static void ProcessReadCommand(void);
                #endif
                        static void ProcessWriteCommand(void);
                        static void ProcessReadCommand(void);
                #endif
-               
+
                void Application_Jump_Check(void) ATTR_INIT_SECTION(3);
 
 #endif
                void Application_Jump_Check(void) ATTR_INIT_SECTION(3);
 
 #endif