Re-add signature byte defines to the DFU and CDC class bootloaders -- the SIGNATURE_x...
authorDean Camera <dean@fourwalledcubicle.com>
Sun, 21 Jun 2009 05:04:18 +0000 (05:04 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Sun, 21 Jun 2009 05:04:18 +0000 (05:04 +0000)
Bootloaders/CDC/BootloaderCDC.c
Bootloaders/CDC/BootloaderCDC.h
Bootloaders/CDC/BootloaderCDC.txt
Bootloaders/CDC/Descriptors.h
Bootloaders/DFU/BootloaderDFU.c
Bootloaders/DFU/BootloaderDFU.h
Bootloaders/DFU/BootloaderDFU.txt
Bootloaders/DFU/Descriptors.h
Bootloaders/TeensyHID/TeensyHID.h

index d72d128..92c2291 100644 (file)
@@ -424,9 +424,9 @@ void CDC_Task(void)
                }\r
                else if (Command == 's')\r
                {\r
-                       WriteNextResponseByte(SIGNATURE_2);             \r
-                       WriteNextResponseByte(SIGNATURE_1);\r
-                       WriteNextResponseByte(SIGNATURE_0);\r
+                       WriteNextResponseByte(AVR_SIGNATURE_3);         \r
+                       WriteNextResponseByte(AVR_SIGNATURE_2);\r
+                       WriteNextResponseByte(AVR_SIGNATURE_1);\r
                }\r
                else if (Command == 'b')\r
                {\r
index 97e32e9..fa98a15 100644 (file)
 \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
                /** CDC Class Specific request to get the line encoding on a CDC-ACM virtual serial port, including the\r
index 1122e73..c518195 100644 (file)
  *    <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
index d913f45..62d7598 100644 (file)
                #include <LUFA/Drivers/USB/USB.h>\r
 \r
        /* Macros: */\r
+               #if defined(__AVR_AT90USB1286__)\r
+                       #define AVR_SIGNATURE_1               0x1E\r
+                       #define AVR_SIGNATURE_2               0x97\r
+                       #define AVR_SIGNATURE_3               0x82\r
+               #elif defined(__AVR_AT90USB1287__)\r
+                       #define AVR_SIGNATURE_1               0x1E\r
+                       #define AVR_SIGNATURE_2               0x97\r
+                       #define AVR_SIGNATURE_3               0x82\r
+               #elif defined(__AVR_AT90USB646__)\r
+                       #define AVR_SIGNATURE_1               0x1E\r
+                       #define AVR_SIGNATURE_2               0x96\r
+                       #define AVR_SIGNATURE_3               0x82\r
+               #elif defined(__AVR_AT90USB647__)\r
+                       #define AVR_SIGNATURE_1               0x1E\r
+                       #define AVR_SIGNATURE_2               0x96\r
+                       #define AVR_SIGNATURE_3               0x82\r
+               #elif defined(__AVR_AT90USB162__)\r
+                       #define AVR_SIGNATURE_1               0x1E\r
+                       #define AVR_SIGNATURE_2               0x94\r
+                       #define AVR_SIGNATURE_3               0x82\r
+               #elif defined(__AVR_AT90USB82__)\r
+                       #define AVR_SIGNATURE_1               0x1E\r
+                       #define AVR_SIGNATURE_2               0x94\r
+                       #define AVR_SIGNATURE_3               0x82\r
+               #elif defined(__AVR_ATmega32U6__)\r
+                       #define AVR_SIGNATURE_1               0x1E\r
+                       #define AVR_SIGNATURE_2               0x95\r
+                       #define AVR_SIGNATURE_3               0x88\r
+               #elif defined(__AVR_ATmega32U4__)\r
+                       #define AVR_SIGNATURE_1               0x1E\r
+                       #define AVR_SIGNATURE_2               0x95\r
+                       #define AVR_SIGNATURE_3               0x87\r
+               #elif defined(__AVR_ATmega16U4__)\r
+                       #define AVR_SIGNATURE_1               0x1E\r
+                       #define AVR_SIGNATURE_2               0x94\r
+                       #define AVR_SIGNATURE_3               0x88\r
+               #else\r
+                       #error The selected AVR part is not currently supported by this bootloader.\r
+               #endif\r
+\r
                /** Structure for a CDC class Functional descriptor, with a given data size. This is used instead of a\r
                 *  type define so that the same macro can be used for functional descriptors of varying data lengths,\r
                 *  while allowing the sizeof() operator to return correct results.\r
index 58a7511..ca0387b 100644 (file)
@@ -678,7 +678,7 @@ static void ProcessWriteCommand(void)
 static void ProcessReadCommand(void)\r
 {\r
        const uint8_t BootloaderInfo[3] = {BOOTLOADER_VERSION, BOOTLOADER_ID_BYTE1, BOOTLOADER_ID_BYTE2};\r
-       const uint8_t SignatureInfo[3]  = {SIGNATURE_0, SIGNATURE_1, SIGNATURE_2};\r
+       const uint8_t SignatureInfo[3]  = {AVR_SIGNATURE_1,    AVR_SIGNATURE_2,     AVR_SIGNATURE_3};\r
 \r
        uint8_t DataIndexToRead = SentCommand.Data[1];\r
 \r
index 776281e..a47da3d 100644 (file)
        \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
index eb6495e..05bfa71 100644 (file)
  *        erase has been performed. 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
  */\r
index 570bb6e..0943ef3 100644 (file)
 \r
                #if defined(__AVR_AT90USB1286__)\r
                        #define PRODUCT_ID_CODE               0x2FFB\r
+                       #define AVR_SIGNATURE_1               0x1E\r
+                       #define AVR_SIGNATURE_2               0x97\r
+                       #define AVR_SIGNATURE_3               0x82\r
                #elif defined(__AVR_AT90USB1287__)\r
                        #define PRODUCT_ID_CODE               0x2FFB\r
+                       #define AVR_SIGNATURE_1               0x1E\r
+                       #define AVR_SIGNATURE_2               0x97\r
+                       #define AVR_SIGNATURE_3               0x82\r
                #elif defined(__AVR_AT90USB646__)\r
                        #define PRODUCT_ID_CODE               0x2FF9\r
+                       #define AVR_SIGNATURE_1               0x1E\r
+                       #define AVR_SIGNATURE_2               0x96\r
+                       #define AVR_SIGNATURE_3               0x82\r
                #elif defined(__AVR_AT90USB647__)\r
                        #define PRODUCT_ID_CODE               0x2FF9\r
+                       #define AVR_SIGNATURE_1               0x1E\r
+                       #define AVR_SIGNATURE_2               0x96\r
+                       #define AVR_SIGNATURE_3               0x82\r
                #elif defined(__AVR_AT90USB162__)\r
                        #define PRODUCT_ID_CODE               0x2FFA\r
+                       #define AVR_SIGNATURE_1               0x1E\r
+                       #define AVR_SIGNATURE_2               0x94\r
+                       #define AVR_SIGNATURE_3               0x82\r
                #elif defined(__AVR_AT90USB82__)\r
                        #define PRODUCT_ID_CODE               0x2FF7\r
+                       #define AVR_SIGNATURE_1               0x1E\r
+                       #define AVR_SIGNATURE_2               0x94\r
+                       #define AVR_SIGNATURE_3               0x82\r
                #elif defined(__AVR_ATmega32U6__)\r
                        #define PRODUCT_ID_CODE               0x2FFB\r
+                       #define AVR_SIGNATURE_1               0x1E\r
+                       #define AVR_SIGNATURE_2               0x95\r
+                       #define AVR_SIGNATURE_3               0x88\r
                #elif defined(__AVR_ATmega32U4__)\r
                        #define PRODUCT_ID_CODE               0x2FF4\r
+                       #define AVR_SIGNATURE_1               0x1E\r
+                       #define AVR_SIGNATURE_2               0x95\r
+                       #define AVR_SIGNATURE_3               0x87\r
                #elif defined(__AVR_ATmega16U4__)\r
                        #define PRODUCT_ID_CODE               0x2FF3\r
+                       #define AVR_SIGNATURE_1               0x1E\r
+                       #define AVR_SIGNATURE_2               0x94\r
+                       #define AVR_SIGNATURE_3               0x88\r
                #else\r
                        #error The selected AVR part is not currently supported by this bootloader.\r
                #endif\r
index 9414eec..b7d4d6b 100644 (file)
@@ -47,8 +47,7 @@
 \r
                #include "Descriptors.h"\r
 \r
-               #include <LUFA/Version.h>                    // Library Version Information\r
-               #include <LUFA/Drivers/USB/USB.h>            // USB Functionality\r
+               #include <LUFA/Drivers/USB/USB.h>\r
                \r
        /* Preprocessor Checks: */\r
                #if !defined(__AVR_AT90USB162__)\r