Renamed USB_Device_SetHighSpeed() to USB_Device_SetFullSpeed() so that the correct...
authorDean Camera <dean@fourwalledcubicle.com>
Fri, 31 Jul 2009 00:35:19 +0000 (00:35 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Fri, 31 Jul 2009 00:35:19 +0000 (00:35 +0000)
Fix USB_PLL_Off() call in the series 4, 6 and 7 microcontroller disconnect interrupt handler code, which wasn't guarded by a test of USB_Options to check if the user has specified manual PLL control (thanks to Brian Dickman).

Bootloaders/TeensyHID/TeensyHID.c
LUFA/Drivers/USB/HighLevel/USBInterrupt.c
LUFA/Drivers/USB/LowLevel/Device.h
LUFA/Drivers/USB/LowLevel/LowLevel.c
LUFA/ManPages/ChangeLog.txt

index 67dded5..5252668 100644 (file)
@@ -33,7 +33,6 @@
  *  Main source file for the TeensyHID bootloader. This file contains the complete bootloader logic.\r
  */\r
  \r
-#define  INCLUDE_FROM_TEENSYHID_C\r
 #include "TeensyHID.h"\r
 \r
 /* Global Variables: */\r
index 20545a4..f0a59ed 100644 (file)
@@ -93,7 +93,10 @@ ISR(USB_GEN_vect, ISR_BLOCK)
                \r
                        USB_Detach();\r
                        USB_CLK_Freeze();\r
-                       USB_PLL_Off();\r
+\r
+                       if (!(USB_Options & USB_OPT_MANUAL_PLL))\r
+                         USB_PLL_Off();\r
+\r
                        USB_REG_Off();\r
 \r
                        EVENT_USB_VBUSDisconnect();\r
index e162a59..d66def4 100644 (file)
        #if !defined(__DOXYGEN__)\r
                /* Macros: */           \r
                        #define USB_Device_SetLowSpeed()        MACROS{ UDCON |=  (1 << LSM);   }MACROE\r
-                       #define USB_Device_SetHighSpeed()       MACROS{ UDCON &= ~(1 << LSM);   }MACROE\r
+                       #define USB_Device_SetFullSpeed()       MACROS{ UDCON &= ~(1 << LSM);   }MACROE\r
        #endif\r
 \r
 #endif\r
index 41d9e10..3ad1e98 100644 (file)
@@ -121,7 +121,9 @@ void USB_ShutDown(void)
        USB_ResetInterface();\r
        USB_Detach();\r
        USB_Controller_Disable();\r
-       USB_PLL_Off();\r
+       \r
+       if (!(USB_Options & USB_OPT_MANUAL_PLL))\r
+         USB_PLL_Off();\r
        \r
        #if defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR)\r
        USB_OTGPAD_Off();\r
@@ -188,7 +190,7 @@ void USB_ResetInterface(void)
                if (USB_Options & USB_DEVICE_OPT_LOWSPEED)\r
                  USB_Device_SetLowSpeed();\r
                else\r
-                 USB_Device_SetHighSpeed();\r
+                 USB_Device_SetFullSpeed();\r
                  \r
                USB_INT_Enable(USB_INT_VBUS);\r
        }\r
index 813a5b4..7adb95f 100644 (file)
@@ -64,6 +64,7 @@
   *    to only unfreeze and check one data pipe at a time) to prevent incorrect device enumerations and freezes while trasferring data\r
   *  - Make Pipe_ConfigurePipe() mask the given endpoint number against PIPE_EPNUM_MASK to ensure the endpoint IN direction bit is\r
   *    cleared to prevent endpoint type corruption\r
+  *  - Fixed USB_OPT_MANUAL_PLL option being ignored during device disconnects on some models (thanks to Brian Dickman)\r
   *  - Fixed documentation mentioning Pipe_GetCurrentToken() function when correct function name is Pipe_GetPipeToken()\r
   *  - Fixed ADC driver for the ATMEGA32U4 and ATMEGA16U4 (thanks to Opendous Inc.)\r
   *  - Fixed CDCHost demo unfreezing the pipes at the point of configuration, rather than use\r