aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-09-29 13:56:52 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-09-29 13:56:52 +0000
commita509729b2d92b03a3d33ab0e1e1950ff65a96a09 (patch)
tree3d0b2af8b2bd50b8380d2e4f753134c997a81d6a /LUFA
parentc0e4f52e8fecf74bc26ba813522aa96300bb844e (diff)
downloadlufa-a509729b2d92b03a3d33ab0e1e1950ff65a96a09.tar.gz
lufa-a509729b2d92b03a3d33ab0e1e1950ff65a96a09.tar.bz2
lufa-a509729b2d92b03a3d33ab0e1e1950ff65a96a09.zip
Changed default value for the reset polarity parameter in the AVRISP-MKII project so that it defaults to active low drive.
Fixed incorrect USB_DeviceState value when unconfiguring the device without an address set.
Diffstat (limited to 'LUFA')
-rw-r--r--LUFA/Drivers/USB/HighLevel/DeviceStandardReq.c5
-rw-r--r--LUFA/Drivers/USB/LowLevel/Device.h8
-rw-r--r--LUFA/Drivers/USB/LowLevel/USBInterrupt.c7
-rw-r--r--LUFA/ManPages/ChangeLog.txt2
-rw-r--r--LUFA/ManPages/LUFAPoweredProjects.txt2
5 files changed, 19 insertions, 5 deletions
diff --git a/LUFA/Drivers/USB/HighLevel/DeviceStandardReq.c b/LUFA/Drivers/USB/HighLevel/DeviceStandardReq.c
index 83c85ded5..d13ac7439 100644
--- a/LUFA/Drivers/USB/HighLevel/DeviceStandardReq.c
+++ b/LUFA/Drivers/USB/HighLevel/DeviceStandardReq.c
@@ -191,7 +191,10 @@ static void USB_Device_SetConfiguration(void)
Endpoint_ClearStatusStage();
- USB_DeviceState = (USB_ConfigurationNumber) ? DEVICE_STATE_Configured : DEVICE_STATE_Addressed;
+ if (USB_ConfigurationNumber)
+ USB_DeviceState = DEVICE_STATE_Configured;
+ else
+ USB_DeviceState = (USB_Device_IsAddressSet()) ? DEVICE_STATE_Configured : DEVICE_STATE_Powered;
EVENT_USB_Device_ConfigurationChanged();
}
diff --git a/LUFA/Drivers/USB/LowLevel/Device.h b/LUFA/Drivers/USB/LowLevel/Device.h
index a37e6d939..2f54d1dd4 100644
--- a/LUFA/Drivers/USB/LowLevel/Device.h
+++ b/LUFA/Drivers/USB/LowLevel/Device.h
@@ -223,7 +223,13 @@
{
UDADDR = ((UDADDR & (1 << ADDEN)) | (Address & 0x7F));
UDADDR |= (1 << ADDEN);
- }
+ }
+
+ static inline bool USB_Device_IsAddressSet(void) ATTR_ALWAYS_INLINE;
+ static inline bool USB_Device_IsAddressSet(void)
+ {
+ return (UDADDR & (1 << ADDEN));
+ }
#endif
#endif
diff --git a/LUFA/Drivers/USB/LowLevel/USBInterrupt.c b/LUFA/Drivers/USB/LowLevel/USBInterrupt.c
index 7844a87d7..21b0a9bb1 100644
--- a/LUFA/Drivers/USB/LowLevel/USBInterrupt.c
+++ b/LUFA/Drivers/USB/LowLevel/USBInterrupt.c
@@ -128,11 +128,14 @@ ISR(USB_GEN_vect, ISR_BLOCK)
USB_INT_Disable(USB_INT_WAKEUPI);
USB_INT_Enable(USB_INT_SUSPI);
+ if (USB_ConfigurationNumber)
+ USB_DeviceState = DEVICE_STATE_Configured;
+ else
+ USB_DeviceState = (USB_Device_IsAddressSet()) ? DEVICE_STATE_Configured : DEVICE_STATE_Powered;
+
#if defined(USB_SERIES_2_AVR) && !defined(NO_LIMITED_CONTROLLER_CONNECT)
- USB_DeviceState = (USB_ConfigurationNumber) ? DEVICE_STATE_Configured : DEVICE_STATE_Powered;
EVENT_USB_Device_Connect();
#else
- USB_DeviceState = (USB_ConfigurationNumber) ? DEVICE_STATE_Configured : DEVICE_STATE_Addressed;
EVENT_USB_Device_WakeUp();
#endif
}
diff --git a/LUFA/ManPages/ChangeLog.txt b/LUFA/ManPages/ChangeLog.txt
index cbedf1840..55cfae073 100644
--- a/LUFA/ManPages/ChangeLog.txt
+++ b/LUFA/ManPages/ChangeLog.txt
@@ -44,6 +44,7 @@
* - All project makefiles now correctly clean intermediate build files from assembly and C++ sources (thanks to Daniel Czigany)
* - Removed the EVENT_USB_InitFailure() event, not specifying a USB mode now defaults to UID selection mode
* - Renamed and moved class driver common constant definitions to make the naming scheme more uniform
+ * - Changed default value for the reset polarity parameter in the AVRISP-MKII project so that it defaults to active low drive
*
* <b>Fixed:</b>
* - Fixed USB_GetHIDReportItemInfo() function modifying the given report item's data when the report item does not exist
@@ -64,6 +65,7 @@
* - Fixed incorrect command name for EEPROM memory programming in the makefile dfu-ee target
* - Fixed BootloaderCDC project failing on some operating systems due to removed Line Encoding options (thanks to Alexey Belyaev)
* - Fixed incorrect LEDs_ChangeLEDs() function in the Benito board LED driver
+ * - Fixed incorrect USB_DeviceState value when unconfiguring the device without an address set
*
* \section Sec_ChangeLog100807 Version 100807
* <b>New:</b>
diff --git a/LUFA/ManPages/LUFAPoweredProjects.txt b/LUFA/ManPages/LUFAPoweredProjects.txt
index ba68f5e88..f1cf03135 100644
--- a/LUFA/ManPages/LUFAPoweredProjects.txt
+++ b/LUFA/ManPages/LUFAPoweredProjects.txt
@@ -38,7 +38,7 @@
* - Arcade Controller: http://fletchtronics.net/arcade-controller-made-petunia
* - AVR USB Modem, a 3G Wireless Modem host: http://code.google.com/p/avrusbmodem/
* - Bicycle POV: http://www.code.google.com/p/bicycleledpov/
- * - BusNinja, an AVR clone of the popular BusPirate project: http://blog.hodgepig.org/busninja/
+ * - Bus Ninja, an AVR clone of the popular BusPirate project: http://blog.hodgepig.org/busninja/
* - CAMTRIG, a remote Camera Trigger device: http://code.astraw.com/projects/motmot/camtrig
* - CD Driver Emulator Dongle for ISO Files: http://cdemu.blogspot.com/
* - ClockTamer, a configurable clock generator: http://code.google.com/p/clock-tamer/