aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-06-22 10:23:47 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-06-22 10:23:47 +0000
commit7d7573e4e554f4b17686a915eba0da12fbebc2ed (patch)
treedb06292821cc9e9f1f99ddb163fca7902a3e80b6 /LUFA
parenta34cccf09931a54a607a56d4ded88f3b7a4752b4 (diff)
downloadlufa-7d7573e4e554f4b17686a915eba0da12fbebc2ed.tar.gz
lufa-7d7573e4e554f4b17686a915eba0da12fbebc2ed.tar.bz2
lufa-7d7573e4e554f4b17686a915eba0da12fbebc2ed.zip
Corrected the ADC driver for the ATMEGA16U4 and ATMEGA32U4 (thanks to Opendous Inc.).
Diffstat (limited to 'LUFA')
-rw-r--r--LUFA/Drivers/Peripheral/AT90USBXXX67/ADC.h25
-rw-r--r--LUFA/Drivers/USB/LowLevel/DevChapter9.h2
-rw-r--r--LUFA/ManPages/ChangeLog.txt2
-rw-r--r--LUFA/ManPages/LUFAPoweredProjects.txt13
4 files changed, 34 insertions, 8 deletions
diff --git a/LUFA/Drivers/Peripheral/AT90USBXXX67/ADC.h b/LUFA/Drivers/Peripheral/AT90USBXXX67/ADC.h
index 358629c70..4cc7c32c3 100644
--- a/LUFA/Drivers/Peripheral/AT90USBXXX67/ADC.h
+++ b/LUFA/Drivers/Peripheral/AT90USBXXX67/ADC.h
@@ -163,8 +163,33 @@
*/
static inline void ADC_SetupChannel(const uint8_t Channel)
{
+ #if (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || \
+ defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB647__) || \
+ defined(__AVR_ATmega32U6__))
DDRF &= ~(1 << Channel);
DIDR0 |= (1 << Channel);
+ #elif (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__))
+ if (Channel < 8)
+ {
+ DDRF &= ~(1 << Channel);
+ DIDR0 |= (1 << Channel);
+ }
+ else if (Channel == 8)
+ {
+ DDRD &= ~(1 << 4);
+ DIDR2 |= (1 << 0);
+ }
+ else if (Channel < 11)
+ {
+ DDRD &= ~(1 << (Channel - 3));
+ DIDR2 |= (1 << (Channel - 8));
+ }
+ else
+ {
+ DDRB &= ~(1 << (Channel - 7));
+ DIDR2 |= (1 << (Channel - 8));
+ }
+ #endif
}
/** Starts the reading of the given channel, but does not wait until the conversion has completed.
diff --git a/LUFA/Drivers/USB/LowLevel/DevChapter9.h b/LUFA/Drivers/USB/LowLevel/DevChapter9.h
index 505256e68..fdef72757 100644
--- a/LUFA/Drivers/USB/LowLevel/DevChapter9.h
+++ b/LUFA/Drivers/USB/LowLevel/DevChapter9.h
@@ -36,8 +36,6 @@
#include <avr/pgmspace.h>
#include <avr/eeprom.h>
#include <avr/boot.h>
- #include <stdlib.h>
- #include <ctype.h>
#include "../HighLevel/StdDescriptors.h"
#include "../HighLevel/Events.h"
diff --git a/LUFA/ManPages/ChangeLog.txt b/LUFA/ManPages/ChangeLog.txt
index 6f116da67..a0998358f 100644
--- a/LUFA/ManPages/ChangeLog.txt
+++ b/LUFA/ManPages/ChangeLog.txt
@@ -30,6 +30,8 @@
* - Extend USB_GetDeviceConfigDescriptor() routine to require the configuration number within the device to fetch
* - Added new USE_INTERNAL_SERIAL define for using the unique serial numbers in some AVR models as the USB device's serial number,
* added NO_INTERNAL_SERIAL compile time option to turn off new serial number reading code
+ * - Fixed ADC driver for the ATMEGA32U4 and ATMEGA16U4 (thanks to Opendous Inc.)
+ *
*
* \section Sec_ChangeLog090605 Version 090605
*
diff --git a/LUFA/ManPages/LUFAPoweredProjects.txt b/LUFA/ManPages/LUFAPoweredProjects.txt
index eb86d611f..2a9b65842 100644
--- a/LUFA/ManPages/LUFAPoweredProjects.txt
+++ b/LUFA/ManPages/LUFAPoweredProjects.txt
@@ -19,24 +19,25 @@
* are open design, and all are available for purchase as completed development boards suitable for project development.
*
* - AVROpendous, an open design/source set of AVR USB development boards: http://avropendous.org/
- * - Teensy and Teensy++, two other AVR USB development boards: http://www.pjrc.com/teensy/index.html
+ * - Benito #7, a no-frills USB board: http://www.dorkbotpdx.org/blog/feurig/benito_7_the_next_big_thing
* - USBFoo, an AT90USB162 based development board: http://shop.kernelconcepts.de/product_info.php?products_id=102
* - USB10 AKA "The Ferret", a AT90USB162 development board: http://www.soc-machines.com
- * - Benito #7, a no-frills USB board: http://www.dorkbotpdx.org/blog/feurig/benito_7_the_next_big_thing
+ * - Teensy and Teensy++, two other AVR USB development boards: http://www.pjrc.com/teensy/index.html
*
* \section Sec_LUFAProjects Projects Using LUFA (Hobbyist)
*
* The following are hobbyist projects using LUFA. Most are open source, and show off interesting ways that the LUFA library
* can be incorporated into many different applications.
*
- * - Stripe Snoop, a Magnetic Card reader: http://www.ossguy.com/ss_usb/
* - Bicycle POV: http://www.code.google.com/p/bicycleledpov/
- * - USB Interface for Playstation Portable Devices: http://forums.ps2dev.org/viewtopic.php?t=11001
- * - USB to Serial Bridge, via SPI and I2C: http://www.tty1.net/userial/
- * - SEGA Megadrive/Genesis Development Cartridge: http://www.spritesmind.net/_GenDev/forum/viewtopic.php?t=464
* - CAMTRIG, a remote Camera Trigger device: http://code.astraw.com/projects/motmot/camtrig
* - Opendous-JTAG, an open source JTAG device: http://code.google.com/p/opendous-jtag/
* - Openkubus, an open source hardware-based authentication dongle: http://code.google.com/p/openkubus/
+ * - Reprap with LUFA, a LUFA powered 3D printer: http://code.google.com/p/at90usb1287-code-for-arduino-and-eclipse/
+ * - SEGA Megadrive/Genesis Development Cartridge: http://www.spritesmind.net/_GenDev/forum/viewtopic.php?t=464
+ * - Stripe Snoop, a Magnetic Card reader: http://www.ossguy.com/ss_usb/
+ * - USB Interface for Playstation Portable Devices: http://forums.ps2dev.org/viewtopic.php?t=11001
+ * - USB to Serial Bridge, via SPI and I2C: http://www.tty1.net/userial/
*
* \section Sec_LUFACommercialProjects Projects Using LUFA (Commercial)
*