Fix flip-ee DFU build target accidentally erasing the target FLASH memory space.
[pub/USBasp.git] / Projects / XPLAINBridge / XPLAINBridge.c
index 3bd1fbf..0b5b612 100644 (file)
@@ -90,7 +90,7 @@ int main(void)
        SetupHardware();
 
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
-       sei();
+       GlobalInterruptEnable();
 
        for (;;)
        {
@@ -226,9 +226,8 @@ void EVENT_USB_Device_ConfigurationChanged(void)
        {
                ConfigSuccess &= Endpoint_ConfigureEndpoint(AVRISP_DATA_OUT_EPADDR, EP_TYPE_BULK, AVRISP_DATA_EPSIZE, 1);
 
-               #if defined(LIBUSB_DRIVER_COMPAT)
-               ConfigSuccess &= Endpoint_ConfigureEndpoint(AVRISP_DATA_IN_EPADDR, EP_TYPE_BULK, AVRISP_DATA_EPSIZE, 1);
-               #endif
+               if ((AVRISP_DATA_IN_EPADDR & ENDPOINT_EPNUM_MASK) != (AVRISP_DATA_OUT_EPADDR & ENDPOINT_EPNUM_MASK))
+                 ConfigSuccess &= Endpoint_ConfigureEndpoint(AVRISP_DATA_IN_EPADDR, EP_TYPE_BULK, AVRISP_DATA_EPSIZE, 1);
 
                /* Configure the V2 protocol packet handler */
                V2Protocol_Init();