Fix RESET_TOGGLES_LIBUSB_COMPAT option not being applied in the AVRISP-MKII descriptors.
authorDean Camera <dean@fourwalledcubicle.com>
Sat, 9 Jun 2012 19:47:14 +0000 (19:47 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Sat, 9 Jun 2012 19:47:14 +0000 (19:47 +0000)
Projects/AVRISP-MKII/AVRISPDescriptors.c
Projects/AVRISP-MKII/AVRISPDescriptors.h

index f3381e1..ab30c0e 100644 (file)
@@ -38,6 +38,7 @@
 #include "AVRISPDescriptors.h"
 
 #if defined(RESET_TOGGLES_LIBUSB_COMPAT) || defined(__DOXYGEN__)
 #include "AVRISPDescriptors.h"
 
 #if defined(RESET_TOGGLES_LIBUSB_COMPAT) || defined(__DOXYGEN__)
+       /** Indicates if an external reset has ocurred and the compatibility mode needs to be altered */
        static bool AVRISP_NeedCompatibilitySwitch ATTR_NO_INIT;
 
        /** Current AVRISP data IN endpoint address. */
        static bool AVRISP_NeedCompatibilitySwitch ATTR_NO_INIT;
 
        /** Current AVRISP data IN endpoint address. */
@@ -207,7 +208,8 @@ uint16_t AVRISP_GetDescriptor(const uint16_t wValue,
                        break;
                case DTYPE_Configuration:
                        *DescriptorMemorySpace = MEMSPACE_RAM;
                        break;
                case DTYPE_Configuration:
                        *DescriptorMemorySpace = MEMSPACE_RAM;
-                       #if defined(RESET_TOGGLES_LIBUSB_COMPAT)                        
+                       #if defined(RESET_TOGGLES_LIBUSB_COMPAT)
+                               /* Update the configuration descriptor with the current endpoint address */
                                AVRISP_ConfigurationDescriptor.AVRISP_DataInEndpoint.EndpointAddress = AVRISP_CurrDataINEndpointAddress;
                        #endif
 
                                AVRISP_ConfigurationDescriptor.AVRISP_DataInEndpoint.EndpointAddress = AVRISP_CurrDataINEndpointAddress;
                        #endif
 
@@ -307,5 +309,7 @@ void UpdateCurrentCompatibilityMode(void)
                        }
                        break;
        }
                        }
                        break;
        }
+       
+       Delay_MS(500);
 }
 #endif
 }
 #endif
index 2779e08..a14515d 100644 (file)
@@ -41,6 +41,8 @@
 
                #include <LUFA/Drivers/USB/USB.h>
                #include <LUFA/Drivers/Board/LEDs.h>
 
                #include <LUFA/Drivers/USB/USB.h>
                #include <LUFA/Drivers/Board/LEDs.h>
+               
+               #include "Config/AppConfig.h"
 
        /* Preprocessor Checks: */
                #if defined(LIBUSB_DRIVER_COMPAT) && defined(RESET_TOGGLES_LIBUSB_COMPAT)
 
        /* Preprocessor Checks: */
                #if defined(LIBUSB_DRIVER_COMPAT) && defined(RESET_TOGGLES_LIBUSB_COMPAT)