Added preprocessor checks and documentation to the bootloaders giving information...
authorDean Camera <dean@fourwalledcubicle.com>
Tue, 7 Apr 2009 04:19:57 +0000 (04:19 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Tue, 7 Apr 2009 04:19:57 +0000 (04:19 +0000)
Bootloaders/CDC/BootloaderCDC.h
Bootloaders/CDC/BootloaderCDC.txt
Bootloaders/DFU/BootloaderDFU.h
Bootloaders/DFU/BootloaderDFU.txt
Demos/Device/MassStorage/MassStorage.c
Demos/Device/RNDISEthernet/RNDIS.h
Demos/Device/RNDISEthernet/RNDISEthernet.c
LUFA/ChangeLog.txt

index dce84a5..7669b83 100644 (file)
 \r
                #include <LUFA/Drivers/USB/USB.h>                // USB Functionality\r
 \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
+\r
        /* Macros: */\r
                /** CDC Class Specific request to get the line encoding on a CDC-ACM virtual serial port, including the\r
                 *  baud rate, parity, stop bits and data bits.\r
        /* Macros: */\r
                /** CDC Class Specific request to get the line encoding on a CDC-ACM virtual serial port, including the\r
                 *  baud rate, parity, stop bits and data bits.\r
index 1f8970d..1122e73 100644 (file)
  *\r
  *  <table>\r
  *   <tr>\r
  *\r
  *  <table>\r
  *   <tr>\r
- *    <td>\r
- *     None\r
- *    </td>\r
+ *    <td><b>Define Name:</b></td>\r
+ *    <td><b>Location:</b></td>\r
+ *    <td><b>Description:</b></td>\r
+ *   </tr>\r
+ *   <tr>\r
+ *    <td>SIGNATURE_0, SIGNATURE_1, SIGNATURE_2</td>\r
+ *    <td>Makefile CDEFS</td>\r
+ *    <td>AVR part signature bytes. These are normally defined as part of the AVR device header files in recent avr-libc\r
+ *        distributions. If your avr-libc library is out of date and does not define these values, you can define them\r
+ *        manually in the makefile CDEFS.</td>\r
  *   </tr>\r
  *  </table>\r
  */
\ No newline at end of file
  *   </tr>\r
  *  </table>\r
  */
\ No newline at end of file
index d0a8254..e996f2b 100644 (file)
                #include "Descriptors.h"\r
                \r
                #include <LUFA/Drivers/USB/USB.h>                // USB Functionality\r
                #include "Descriptors.h"\r
                \r
                #include <LUFA/Drivers/USB/USB.h>                // USB Functionality\r
-               \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
+       \r
        /* Macros: */\r
                /** Configuration define. Define this token to true to case the bootloader to reject all memory commands\r
                 *  until a memory erase has been performed. When used in conjunction with the lockbits of the AVR, this\r
        /* Macros: */\r
                /** Configuration define. Define this token to true to case the bootloader to reject all memory commands\r
                 *  until a memory erase has been performed. When used in conjunction with the lockbits of the AVR, this\r
index 7107cc1..44158ed 100644 (file)
  *        erase has been perfomed. This can be used in conjunction with the AVR's lockbits to prevent the AVRs firmware from\r
  *        being dumped by unauthorized persons.</td>\r
  *   </tr>\r
  *        erase has been perfomed. This can be used in conjunction with the AVR's lockbits to prevent the AVRs firmware from\r
  *        being dumped by unauthorized persons.</td>\r
  *   </tr>\r
+ *   <tr>\r
+ *    <td>SIGNATURE_0, SIGNATURE_1, SIGNATURE_2</td>\r
+ *    <td>Makefile CDEFS</td>\r
+ *    <td>AVR part signature bytes. These are normally defined as part of the AVR device header files in recent avr-libc\r
+ *        distributions. If your avr-libc library is out of date and does not define these values, you can define them\r
+ *        manually in the makefile CDEFS.</td>\r
+ *   </tr>\r
  *  </table>\r
  */
\ No newline at end of file
  *  </table>\r
  */
\ No newline at end of file
index 4032648..56bc19a 100644 (file)
@@ -386,7 +386,7 @@ STREAM_CALLBACK(AbortOnMassStoreReset)
 /** ISR for the general Pipe/Endpoint interrupt vector. This ISR fires when a control request has been issued to the control endpoint,\r
  *  so that the request can be processed. As several elements of the Mass Storage implementation require asynchronous control requests\r
  *  (such as endpoint stall clearing and Mass Storage Reset requests during data transfers) this is done via interrupts rather than\r
 /** ISR for the general Pipe/Endpoint interrupt vector. This ISR fires when a control request has been issued to the control endpoint,\r
  *  so that the request can be processed. As several elements of the Mass Storage implementation require asynchronous control requests\r
  *  (such as endpoint stall clearing and Mass Storage Reset requests during data transfers) this is done via interrupts rather than\r
- *  polling.\r
+ *  polling so that they can be processed regardless of the rest of the application's state.\r
  */\r
 ISR(ENDPOINT_PIPE_vect, ISR_BLOCK)\r
 {\r
  */\r
 ISR(ENDPOINT_PIPE_vect, ISR_BLOCK)\r
 {\r
index 0d240ac..88c9a9e 100644 (file)
                #define REMOTE_NDIS_VERSION_MINOR             0x00\r
        \r
                /** RNDIS request to issue a host-to-device NDIS command */\r
                #define REMOTE_NDIS_VERSION_MINOR             0x00\r
        \r
                /** RNDIS request to issue a host-to-device NDIS command */\r
-               #define SEND_ENCAPSULATED_COMMAND             0x00\r
+               #define REQ_SendEncapsulatedCommand           0x00\r
 \r
                /** RNDIS request to issue a device-to-host NDIS response */\r
 \r
                /** RNDIS request to issue a device-to-host NDIS response */\r
-               #define GET_ENCAPSULATED_RESPONSE             0x01\r
+               #define REQ_GetEncapsulatedResponse           0x01\r
                \r
        /* Enums: */\r
                /** Enum for the possible NDIS adapter states. */\r
                \r
        /* Enums: */\r
                /** Enum for the possible NDIS adapter states. */\r
index 98863a1..78c77c8 100644 (file)
@@ -158,7 +158,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
        /* Process RNDIS class commands */\r
        switch (bRequest)\r
        {\r
        /* Process RNDIS class commands */\r
        switch (bRequest)\r
        {\r
-               case SEND_ENCAPSULATED_COMMAND:\r
+               case REQ_SendEncapsulatedCommand:\r
                        if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {\r
                                /* Clear the SETUP packet, ready for data transfer */\r
                        if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {\r
                                /* Clear the SETUP packet, ready for data transfer */\r
@@ -175,7 +175,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                        }\r
                        \r
                        break;\r
                        }\r
                        \r
                        break;\r
-               case GET_ENCAPSULATED_RESPONSE:\r
+               case REQ_GetEncapsulatedResponse:\r
                        if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {\r
                                /* Check if a response to the last message is ready */\r
                        if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {\r
                                /* Check if a response to the last message is ready */\r
index b4ecc89..0b15df0 100644 (file)
   *  - Added new PIMA_DATA_SIZE() define to the Still Image Host demo\r
   *  - Add call to MassStore_WaitForDataReceived() in MassStore_GetReturnedStatus() to ensure that the CSW has been received in the\r
   *    extended MSC timeout period before continuing, to prevent long processing delays from causing the MassStore_GetReturnedStatus()\r
   *  - Added new PIMA_DATA_SIZE() define to the Still Image Host demo\r
   *  - Add call to MassStore_WaitForDataReceived() in MassStore_GetReturnedStatus() to ensure that the CSW has been received in the\r
   *    extended MSC timeout period before continuing, to prevent long processing delays from causing the MassStore_GetReturnedStatus()\r
-  *    to early-abort\r
+  *    to early-abort (thanks to Dmitry Maksimov)\r
   *  - Move StdRequestType.h, StreamCallbacks.h, USBMode.h from the LowLevel USB driver directory to the HighLevel USB driver directory,\r
   *    where they are more suited\r
   *  - Removed all binary constants and replaced with decimal or hexadecimal constants so that unpatched GCC compilers can still build the\r
   *    code without having to be itself patched and recompiled first\r
   *  - Move StdRequestType.h, StreamCallbacks.h, USBMode.h from the LowLevel USB driver directory to the HighLevel USB driver directory,\r
   *    where they are more suited\r
   *  - Removed all binary constants and replaced with decimal or hexadecimal constants so that unpatched GCC compilers can still build the\r
   *    code without having to be itself patched and recompiled first\r
+  *  - Added preprocessor checks and documentation to the bootloaders giving information about missing SIGNATURE_x defines due to\r
+  *    outdated avr-libc versions.\r
   *\r
   *  \section Sec_ChangeLog090401 Version 090401\r
   *\r
   *\r
   *  \section Sec_ChangeLog090401 Version 090401\r
   *\r