Finished basic documentation of all device mode class drivers.
[pub/lufa.git] / Bootloaders / DFU / BootloaderDFU.c
index 10a3016..6da741e 100644 (file)
@@ -139,7 +139,7 @@ int main (void)
 /** Event handler for the USB_Disconnect event. This indicates that the bootloader should exit and the user\r
  *  application started.\r
  */\r
-void EventHandler_USB_Disconnect(void)\r
+void EVENT_USB_Disconnect(void)\r
 {\r
        /* Upon disconnection, run user application */\r
        RunBootloader = false;\r
@@ -149,7 +149,7 @@ void EventHandler_USB_Disconnect(void)
  *  control requests that are not handled internally by the USB library (including the DFU commands, which are\r
  *  all issued via the control endpoint), so that they can be handled appropriately for the application.\r
  */\r
-void EventHandler_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_UnhandledControlPacket(void)\r
 {\r
        /* Get the size of the command and data from the wLength value */\r
        SentCommand.DataSize = USB_ControlRequest.wLength;\r
@@ -342,7 +342,7 @@ void EventHandler_USB_UnhandledControlPacket(void)
                                                }\r
 \r
                                                /* Read the flash word and send it via USB to the host */\r
-                                               #if defined(RAMPZ)\r
+                                               #if (FLASHEND > 0xFFFF)\r
                                                        Endpoint_Write_Word_LE(pgm_read_word_far(CurrFlashAddress.Long));\r
                                                #else\r
                                                        Endpoint_Write_Word_LE(pgm_read_word(CurrFlashAddress.Long));                                                   \r
@@ -462,8 +462,10 @@ static void DiscardFillerBytes(uint8_t NumberOfBytes)
                        /* Wait until next data packet received */\r
                        while (!(Endpoint_IsOUTReceived()));\r
                }\r
-\r
-               Endpoint_Discard_Byte();                                                \r
+               else\r
+               {\r
+                       Endpoint_Discard_Byte();\r
+               }\r
        }\r
 }\r
 \r
@@ -585,7 +587,7 @@ static void ProcessMemReadCommand(void)
                while (CurrFlashAddress < BOOT_START_ADDR)\r
                {\r
                        /* Check if the current byte is not blank */\r
-                       #if defined(RAMPZ)\r
+                       #if (FLASHEND > 0xFFFF)\r
                        if (pgm_read_byte_far(CurrFlashAddress) != 0xFF)\r
                        #else\r
                        if (pgm_read_byte(CurrFlashAddress) != 0xFF)\r