Be doubly-certain that the incomming CDC class driver's endpoint/pipe is flushed...
[pub/USBasp.git] / Bootloaders / DFU / BootloaderDFU.h
index 776281e..ca53266 100644 (file)
@@ -1,21 +1,21 @@
 /*\r
              LUFA Library\r
-     Copyright (C) Dean Camera, 2009.\r
+     Copyright (C) Dean Camera, 2010.\r
               \r
   dean [at] fourwalledcubicle [dot] com\r
       www.fourwalledcubicle.com\r
 */\r
 \r
 /*\r
-  Copyright 2009  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
-\r
-  Permission to use, copy, modify, and distribute this software\r
-  and its documentation for any purpose and without fee is hereby\r
-  granted, provided that the above copyright notice appear in all\r
-  copies and that both that the copyright notice and this\r
-  permission notice and warranty disclaimer appear in supporting\r
-  documentation, and that the name of the author not be used in\r
-  advertising or publicity pertaining to distribution of the\r
+  Copyright 2010  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
+\r
+  Permission to use, copy, modify, distribute, and sell this \r
+  software and its documentation for any purpose is hereby granted\r
+  without fee, provided that the above copyright notice appear in \r
+  all copies and that both that the copyright notice and this\r
+  permission notice and warranty disclaimer appear in supporting \r
+  documentation, and that the name of the author not be used in \r
+  advertising or publicity pertaining to distribution of the \r
   software without specific, written prior permission.\r
 \r
   The author disclaim all warranties with regard to this\r
        \r
                #include "Descriptors.h"\r
                \r
-               #include <LUFA/Drivers/USB/USB.h>                // USB Functionality\r
-       \r
-       /* Preprocessor Checks: */\r
-               #if !defined(SIGNATURE_0) || !defined(SIGNATURE_1) || !defined(SIGNATURE_2)\r
-                       #error Device signature byte constants are not defined due to outdated avr-libc version. See demo documentation.\r
-               #endif\r
+               #include <LUFA/Drivers/USB/USB.h>\r
        \r
        /* Macros: */\r
                /** Configuration define. Define this token to true to case the bootloader to reject all memory commands\r
@@ -60,7 +55,7 @@
                 *  can protect the AVR's firmware from being dumped from a secured AVR. When false, memory operations are\r
                 *  allowed at any time.\r
                 */\r
-               #define SECURE_MODE           false\r
+               #define SECURE_MODE              false\r
 \r
                /** Major bootloader version number. */\r
                #define BOOTLOADER_VERSION_MINOR 2\r
                \r
                /** Convenience macro, used to determine if the issued command is the given one-byte long command.\r
                 *\r
-                *  \param dataarr  Command byte array to check against\r
-                *  \param cb1      First command byte to check\r
+                *  \param[in] dataarr  Command byte array to check against\r
+                *  \param[in] cb1      First command byte to check\r
                 */\r
-               #define IS_ONEBYTE_COMMAND(dataarr, cb1)       (dataarr[0] == cb1)\r
+               #define IS_ONEBYTE_COMMAND(dataarr, cb1)       (dataarr[0] == (cb1))\r
 \r
                /** Convenience macro, used to determine if the issued command is the given two-byte long command.\r
                 *\r
-                *  \param dataarr  Command byte array to check against\r
-                *  \param cb1      First command byte to check\r
-                *  \param cb2      Second command byte to check\r
+                *  \param[in] dataarr  Command byte array to check against\r
+                *  \param[in] cb1      First command byte to check\r
+                *  \param[in] cb2      Second command byte to check\r
                 */\r
-               #define IS_TWOBYTE_COMMAND(dataarr, cb1, cb2) ((dataarr[0] == cb1) && (dataarr[1] == cb2))\r
+               #define IS_TWOBYTE_COMMAND(dataarr, cb1, cb2) ((dataarr[0] == (cb1)) && (dataarr[1] == (cb2)))\r
        \r
                /** Length of the DFU file suffix block, appended to the end of each complete memory write command.\r
                 *  The DFU file suffix is currently unused (but is designed to give extra file information, such as\r
                void SetupHardware(void);\r
                void ResetHardware(void);\r
 \r
-               void EVENT_USB_Disconnect(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_UnhandledControlRequest(void);\r
 \r
                #if defined(INCLUDE_FROM_BOOTLOADER_C)\r
                        static void DiscardFillerBytes(uint8_t NumberOfBytes);\r