Corrected the ADC driver for the ATMEGA16U4 and ATMEGA32U4 (thanks to Opendous Inc.).
authorDean Camera <dean@fourwalledcubicle.com>
Mon, 22 Jun 2009 10:23:47 +0000 (10:23 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Mon, 22 Jun 2009 10:23:47 +0000 (10:23 +0000)
Demos/OTG/TestApp/TestApp.c
LUFA/Drivers/Peripheral/AT90USBXXX67/ADC.h
LUFA/Drivers/USB/LowLevel/DevChapter9.h
LUFA/ManPages/ChangeLog.txt
LUFA/ManPages/LUFAPoweredProjects.txt

index dc10aad..778c14b 100644 (file)
@@ -44,7 +44,7 @@ int main(void)
        SetupHardware();\r
        \r
        puts_P(PSTR(ESC_RESET ESC_BG_WHITE ESC_INVERSE_ON ESC_ERASE_DISPLAY\r
-              "LUFA Demo running.\r\n" ESC_INVERSE_OFF));\r
+                   "LUFA Demo running.\r\n" ESC_INVERSE_OFF));\r
 \r
        for (;;)\r
        {\r
index 358629c..4cc7c32 100644 (file)
                         */\r
                        static inline void ADC_SetupChannel(const uint8_t Channel)\r
                        {\r
+                               #if (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || \\r
+                                        defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB647__) || \\r
+                                        defined(__AVR_ATmega32U6__))                           \r
                                DDRF  &= ~(1 << Channel);\r
                                DIDR0 |=  (1 << Channel);\r
+                               #elif (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__))\r
+                               if (Channel < 8)\r
+                               {\r
+                                       DDRF  &= ~(1 << Channel);\r
+                                       DIDR0 |=  (1 << Channel);\r
+                               }\r
+                               else if (Channel == 8)\r
+                               {\r
+                                       DDRD  &= ~(1 << 4);\r
+                                       DIDR2 |=  (1 << 0);\r
+                               }\r
+                               else if (Channel < 11)\r
+                               {\r
+                                       DDRD  &= ~(1 << (Channel - 3));\r
+                                       DIDR2 |=  (1 << (Channel - 8));\r
+                               }\r
+                               else\r
+                               {\r
+                                       DDRB  &= ~(1 << (Channel - 7));\r
+                                       DIDR2 |=  (1 << (Channel - 8));\r
+                               }\r
+                               #endif\r
                        }\r
                        \r
                        /** Starts the reading of the given channel, but does not wait until the conversion has completed.\r
index 505256e..fdef727 100644 (file)
@@ -36,8 +36,6 @@
                #include <avr/pgmspace.h>\r
                #include <avr/eeprom.h>\r
                #include <avr/boot.h>\r
-               #include <stdlib.h>\r
-               #include <ctype.h>\r
                \r
                #include "../HighLevel/StdDescriptors.h"\r
                #include "../HighLevel/Events.h"\r
index 6f116da..a099835 100644 (file)
@@ -30,6 +30,8 @@
   *  - Extend USB_GetDeviceConfigDescriptor() routine to require the configuration number within the device to fetch\r
   *  - Added new USE_INTERNAL_SERIAL define for using the unique serial numbers in some AVR models as the USB device's serial number,\r
   *    added NO_INTERNAL_SERIAL compile time option to turn off new serial number reading code\r
+  *  - Fixed ADC driver for the ATMEGA32U4 and ATMEGA16U4 (thanks to Opendous Inc.)\r
+  *\r
   *\r
   *  \section Sec_ChangeLog090605 Version 090605\r
   *\r
index eb86d61..2a9b658 100644 (file)
  *  are open design, and all are available for purchase as completed development boards suitable for project development.\r
  *\r
  *  - AVROpendous, an open design/source set of AVR USB development boards: http://avropendous.org/\r
- *  - Teensy and Teensy++, two other AVR USB development boards: http://www.pjrc.com/teensy/index.html\r
+ *  - Benito #7, a no-frills USB board: http://www.dorkbotpdx.org/blog/feurig/benito_7_the_next_big_thing\r
  *  - USBFoo, an AT90USB162 based development board: http://shop.kernelconcepts.de/product_info.php?products_id=102\r
  *  - USB10 AKA "The Ferret", a AT90USB162 development board: http://www.soc-machines.com\r
- *  - Benito #7, a no-frills USB board: http://www.dorkbotpdx.org/blog/feurig/benito_7_the_next_big_thing\r
+ *  - Teensy and Teensy++, two other AVR USB development boards: http://www.pjrc.com/teensy/index.html\r
  * \r
  *  \section Sec_LUFAProjects Projects Using LUFA (Hobbyist)\r
  *\r
  *  The following are hobbyist projects using LUFA. Most are open source, and show off interesting ways that the LUFA library\r
  *  can be incorporated into many different applications.\r
  *\r
- *  - Stripe Snoop, a Magnetic Card reader: http://www.ossguy.com/ss_usb/\r
  *  - Bicycle POV: http://www.code.google.com/p/bicycleledpov/\r
- *  - USB Interface for Playstation Portable Devices: http://forums.ps2dev.org/viewtopic.php?t=11001\r
- *  - USB to Serial Bridge, via SPI and I2C: http://www.tty1.net/userial/\r
- *  - SEGA Megadrive/Genesis Development Cartridge: http://www.spritesmind.net/_GenDev/forum/viewtopic.php?t=464\r
  *  - CAMTRIG, a remote Camera Trigger device: http://code.astraw.com/projects/motmot/camtrig\r
  *  - Opendous-JTAG, an open source JTAG device: http://code.google.com/p/opendous-jtag/\r
  *  - Openkubus, an open source hardware-based authentication dongle: http://code.google.com/p/openkubus/\r
+ *  - Reprap with LUFA, a LUFA powered 3D printer: http://code.google.com/p/at90usb1287-code-for-arduino-and-eclipse/\r
+ *  - SEGA Megadrive/Genesis Development Cartridge: http://www.spritesmind.net/_GenDev/forum/viewtopic.php?t=464\r
+ *  - Stripe Snoop, a Magnetic Card reader: http://www.ossguy.com/ss_usb/\r
+ *  - USB Interface for Playstation Portable Devices: http://forums.ps2dev.org/viewtopic.php?t=11001\r
+ *  - USB to Serial Bridge, via SPI and I2C: http://www.tty1.net/userial/\r
  * \r
  *  \section Sec_LUFACommercialProjects Projects Using LUFA (Commercial)\r
  *\r