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).
* 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
\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
#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
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
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
* 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