X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/c5038f1bf44aea75f1ae1ed035cb7d523ccfdacb..03ee87b35abdb8b92e8b55ec040fa943f9a6786c:/LUFA/Drivers/USB/HighLevel/USBInterrupt.c?ds=inline diff --git a/LUFA/Drivers/USB/HighLevel/USBInterrupt.c b/LUFA/Drivers/USB/HighLevel/USBInterrupt.c index 56e54f25a..ee6d16efc 100644 --- a/LUFA/Drivers/USB/HighLevel/USBInterrupt.c +++ b/LUFA/Drivers/USB/HighLevel/USBInterrupt.c @@ -1,21 +1,21 @@ /* LUFA Library - Copyright (C) Dean Camera, 2009. + Copyright (C) Dean Camera, 2010. dean [at] fourwalledcubicle [dot] com www.fourwalledcubicle.com */ /* - Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, and distribute this software - and its documentation for any purpose and without fee is hereby - granted, provided that the above copyright notice appear in all - copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the + Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaim all warranties with regard to this @@ -148,11 +148,18 @@ ISR(USB_GEN_vect, ISR_BLOCK) ENDPOINT_BANK_SINGLE); #if defined(INTERRUPT_CONTROL_ENDPOINT) - USB_INT_Enable(USB_INT_ENDPOINT_SETUP); + USB_INT_Enable(USB_INT_RXSTPI); #endif EVENT_USB_Device_Reset(); } + + if (USB_INT_HasOccurred(USB_INT_SOFI) && USB_INT_IsEnabled(USB_INT_SOFI)) + { + USB_INT_Clear(USB_INT_SOFI); + + EVENT_USB_Device_StartOfFrame(); + } #endif #if defined(USB_CAN_BE_HOST) @@ -209,7 +216,7 @@ ISR(USB_GEN_vect, ISR_BLOCK) USB_INT_Clear(USB_INT_IDTI); if (USB_DeviceState != DEVICE_STATE_Unattached) - EVENT_USB_Disconnect(); + EVENT_USB_Device_Disconnect(); if (USB_HostState != HOST_STATE_Unattached) EVENT_USB_Host_DeviceUnattached(); @@ -222,15 +229,15 @@ ISR(USB_GEN_vect, ISR_BLOCK) #endif } -#if defined(INTERRUPT_CONTROL_ENDPOINT) -ISR(USB_COM_vect, ISR_NOBLOCK) +#if defined(INTERRUPT_CONTROL_ENDPOINT) && defined(USB_CAN_BE_DEVICE) +ISR(USB_COM_vect, ISR_BLOCK) { uint8_t PrevSelectedEndpoint = Endpoint_GetCurrentEndpoint(); USB_USBTask(); - USB_INT_Clear(USB_INT_ENDPOINT_SETUP); + USB_INT_Clear(USB_INT_RXSTPI); - Endpoint_SelectEndpoint(PrevSelectedEndpoint); + Endpoint_SelectEndpoint(PrevSelectedEndpoint); } #endif