Fixed USB driver failing to define the PLL prescaler mask for the ATMEGA8U2 and ATMEG...
authorDean Camera <dean@fourwalledcubicle.com>
Sun, 29 Nov 2009 07:41:54 +0000 (07:41 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Sun, 29 Nov 2009 07:41:54 +0000 (07:41 +0000)
Simplified the USB.h master include file's target validity checks.

LUFA/Drivers/USB/HighLevel/StdDescriptors.h
LUFA/Drivers/USB/LowLevel/LowLevel.h
LUFA/Drivers/USB/USB.h
LUFA/ManPages/ChangeLog.txt

index 9e5764b..19ca8aa 100644 (file)
                        {\r
                                USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */\r
                                \r
                        {\r
                                USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */\r
                                \r
-                               int16_t     UnicodeString[]; /**< String data, as unicode characters (alternatively,\r
-                                                             *   string language IDs). If normal ASCII characters are\r
-                                                             *   to be used, they must be added as an array of characters\r
-                                                             *   rather than a normal C string so that they are widened to\r
-                                                             *   Unicode size.\r
-                                                             *\r
-                                                             *   Under GCC, strings prefixed with the "L" character (before\r
-                                                             *   the opening string quotation mark) are considered to be\r
-                                                             *   Unicode strings, and may be used instead of an explicit\r
-                                                             *   array of ASCII characters.\r
-                                                             */\r
+                               wchar_t UnicodeString[];  /**< String data, as unicode characters (alternatively,\r
+                                                          *   string language IDs). If normal ASCII characters are\r
+                                                          *   to be used, they must be added as an array of characters\r
+                                                          *   rather than a normal C string so that they are widened to\r
+                                                          *   Unicode size.\r
+                                                          *\r
+                                                          *   Under GCC, strings prefixed with the "L" character (before\r
+                                                          *   the opening string quotation mark) are considered to be\r
+                                                          *   Unicode strings, and may be used instead of an explicit\r
+                                                          *   array of ASCII characters.\r
+                                                          */\r
                        } USB_Descriptor_String_t;\r
 \r
                        /** Type define for a standard string descriptor. Unlike other standard descriptors, the length\r
                        } USB_Descriptor_String_t;\r
 \r
                        /** Type define for a standard string descriptor. Unlike other standard descriptors, the length\r
index 743a318..8b441c2 100644 (file)
@@ -75,7 +75,8 @@
                #endif\r
        \r
                #if (F_CLOCK == 8000000)\r
                #endif\r
        \r
                #if (F_CLOCK == 8000000)\r
-                       #if (defined(__AVR_AT90USB82__) || defined(__AVR_AT90USB162__))\r
+                       #if (defined(__AVR_AT90USB82__) || defined(__AVR_AT90USB162__) || \\r
+                            defined(__AVR_ATMEGA8U2__) || defined(__AVR_ATMEGA16U2__))\r
                                #define USB_PLL_PSC                0\r
                        #elif (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__))\r
                                #define USB_PLL_PSC                0\r
                                #define USB_PLL_PSC                0\r
                        #elif (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__))\r
                                #define USB_PLL_PSC                0\r
@@ -85,7 +86,8 @@
                                #define USB_PLL_PSC                ((1 << PLLP1) | (1 << PLLP0))\r
                        #endif\r
                #elif (F_CLOCK == 16000000)\r
                                #define USB_PLL_PSC                ((1 << PLLP1) | (1 << PLLP0))\r
                        #endif\r
                #elif (F_CLOCK == 16000000)\r
-                       #if (defined(__AVR_AT90USB82__) || defined(__AVR_AT90USB162__))\r
+                       #if (defined(__AVR_AT90USB82__) || defined(__AVR_AT90USB162__) || \\r
+                            defined(__AVR_ATMEGA8U2__) || defined(__AVR_ATMEGA16U2__))\r
                                #define USB_PLL_PSC                (1 << PLLP0)\r
                        #elif (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__))\r
                                #define USB_PLL_PSC                (1 << PINDIV)\r
                                #define USB_PLL_PSC                (1 << PLLP0)\r
                        #elif (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__))\r
                                #define USB_PLL_PSC                (1 << PINDIV)\r
index b40d6ab..0d0a3f7 100644 (file)
 #ifndef __USB_H__\r
 #define __USB_H__\r
 \r
 #ifndef __USB_H__\r
 #define __USB_H__\r
 \r
+       /* Includes: */\r
+               #include "HighLevel/USBMode.h"\r
+\r
        /* Preprocessor Checks: */              \r
        /* Preprocessor Checks: */              \r
-               #if (!(defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB647__) ||  \\r
-                      defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) ||  \\r
-                          defined(__AVR_AT90USB162__)  || defined(__AVR_AT90USB82__)  ||  \\r
-                          defined(__AVR_ATmega32U2__)  || defined(__AVR_ATmega16U2__) ||  \\r
-                          defined(__AVR_ATmega8U2__)   ||                                 \\r
-                          defined(__AVR_ATmega16U4__)  || defined(__AVR_ATmega32U4__) ||  \\r
-                          defined(__AVR_ATmega32U6__)))\r
+               #if (!defined(USB_SERIES_2_AVR) && !defined(USB_SERIES_4_AVR) && \\r
+                    !defined(USB_SERIES_6_AVR) && !defined(USB_SERIES_7_AVR))\r
                        #error The currently selected AVR model is not supported under the USB component of the LUFA library.\r
                #endif\r
                \r
        /* Includes: */\r
                        #error The currently selected AVR model is not supported under the USB component of the LUFA library.\r
                #endif\r
                \r
        /* Includes: */\r
-               #include "HighLevel/USBMode.h"\r
                #include "HighLevel/USBTask.h"\r
                #include "HighLevel/USBInterrupt.h"\r
                #include "HighLevel/Events.h"\r
                #include "HighLevel/USBTask.h"\r
                #include "HighLevel/USBInterrupt.h"\r
                #include "HighLevel/Events.h"\r
index 8f7a410..4b37995 100644 (file)
@@ -40,6 +40,7 @@
   *  - Fixed host state machine not enabling Auto VBUS mode when HOST_DEVICE_SETTLE_DELAY_MS is set to zero\r
   *  - Fixed misnamed Pipe_SetPipeToken() macro for setting a pipe's direction\r
   *  - Fixed CDCHost failing on devices with bidirectional endpoints\r
   *  - Fixed host state machine not enabling Auto VBUS mode when HOST_DEVICE_SETTLE_DELAY_MS is set to zero\r
   *  - Fixed misnamed Pipe_SetPipeToken() macro for setting a pipe's direction\r
   *  - Fixed CDCHost failing on devices with bidirectional endpoints\r
+  *  - Fixed USB driver failing to define the PLL prescaler mask for the ATMEGA8U2 and ATMEGA16U2\r
   *\r
   *  \section Sec_ChangeLog091122 Version 091122\r
   *\r
   *\r
   *  \section Sec_ChangeLog091122 Version 091122\r
   *\r