Don't cast the line encoding baud rate to a uint16_t before performing the baud rate...
[pub/USBasp.git] / Bootloaders / TeensyHID / Descriptors.h
index 0ea7f39..8ef964d 100644 (file)
                \r
                /** Descriptor header type value, to indicate a HID class HID report descriptor. */\r
                #define DTYPE_Report              0x22\r
+               \r
+               /** Vendor usage page for the Teensy 1.0 board */\r
+               #define TEENSY_USAGEPAGE_10       0x19\r
+\r
+               /** Vendor usage page for the Teensy++ 1.0 board */\r
+               #define TEENSY_USAGEPAGE_10PP     0x1A\r
+\r
+               /** Vendor usage page for the Teensy 2.0 board */\r
+               #define TEENSY_USAGEPAGE_20       0x1B\r
+               \r
+               /** Vendor usage page for the Teensy++ 2.0 board */\r
+               #define TEENSY_USAGEPAGE_20PP     0x1C\r
+               \r
+               #if (defined(__AVR_AT90USB162__) || defined(__AVR_ATmega16U2__))\r
+                       #define TEENSY_USAGEPAGE      TEENSY_USAGEPAGE_10\r
+               #elif defined(__AVR_ATmega32U4__)\r
+                       #define TEENSY_USAGEPAGE      TEENSY_USAGEPAGE_20\r
+               #elif (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__))\r
+                       #define TEENSY_USAGEPAGE      TEENSY_USAGEPAGE_10PP\r
+               #elif (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__))\r
+                       #define TEENSY_USAGEPAGE      TEENSY_USAGEPAGE_20PP\r
+               #else\r
+                       #error The selected AVR model is not currently supported by the TeensyHID bootloader.\r
+               #endif\r
 \r
        /* Function Prototypes: */\r
                uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)\r