}\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
\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
* <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
#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
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
\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
* 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
\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
\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