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 cf8e834..8ef964d 100644 (file)
@@ -1,13 +1,13 @@
 /*\r
              LUFA Library\r
-     Copyright (C) Dean Camera, 2009.\r
+     Copyright (C) Dean Camera, 2010.\r
               \r
   dean [at] fourwalledcubicle [dot] com\r
       www.fourwalledcubicle.com\r
 */\r
 \r
 /*\r
-  Copyright 2009  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
+  Copyright 2010  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
          \r
   Permission to use, copy, modify, distribute, and sell this \r
   software and its documentation for any purpose is hereby granted\r
@@ -66,9 +66,9 @@
                typedef struct\r
                {\r
                        USB_Descriptor_Configuration_Header_t Config;\r
-                       USB_Descriptor_Interface_t            Interface;\r
-                       USB_Descriptor_HID_t                  HIDDescriptor;\r
-               USB_Descriptor_Endpoint_t             HIDEndpoint;\r
+                       USB_Descriptor_Interface_t            HID_Interface;\r
+                       USB_Descriptor_HID_t                  HID_VendorHID;\r
+               USB_Descriptor_Endpoint_t             HID_ReportINEndpoint;\r
                } USB_Descriptor_Configuration_t;\r
                                        \r
        /* Macros: */\r
                \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