From d1e52660368d34d693131f6aff3c8fd8584162e5 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Mon, 1 Jun 2009 11:03:39 +0000 Subject: Commit of new class abstraction APIs for all device demos other than the MIDI demo - not documented yet. Removed scheduler and memory allocation libraries. Added new EVENT_USB_StartOfFrame event in the library to indicate the start of each USB frame (when generated). Removed Tx interrupt from the USBtoSerial demo; now sends characters via polling to ensure more time for the Rx interrupt. --- LUFA/Drivers/USB/LowLevel/Host.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'LUFA/Drivers/USB/LowLevel/Host.c') diff --git a/LUFA/Drivers/USB/LowLevel/Host.c b/LUFA/Drivers/USB/LowLevel/Host.c index b606515e6..02a1c2171 100644 --- a/LUFA/Drivers/USB/LowLevel/Host.c +++ b/LUFA/Drivers/USB/LowLevel/Host.c @@ -210,14 +210,13 @@ uint8_t USB_Host_WaitMS(uint8_t MS) bool BusSuspended = USB_Host_IsBusSuspended(); uint8_t ErrorCode = HOST_WAITERROR_Successful; - USB_INT_Clear(USB_INT_HSOFI); USB_Host_ResumeBus(); while (MS) { - if (USB_INT_HasOccurred(USB_INT_HSOFI)) + if (FrameElapsed) { - USB_INT_Clear(USB_INT_HSOFI); + FrameElapsed = false; MS--; } @@ -260,9 +259,10 @@ static void USB_Host_ResetDevice(void) USB_Host_ResetBus(); while (!(USB_Host_IsBusResetComplete())); - USB_INT_Clear(USB_INT_HSOFI); USB_Host_ResumeBus(); + FrameElapsed = false; + for (uint8_t MSRem = 10; MSRem != 0; MSRem--) { /* Workaround for powerless-pull-up devices. After a USB bus reset, @@ -270,8 +270,10 @@ static void USB_Host_ResetDevice(void) looked for - if it is found within 10ms, the device is still present. */ - if (USB_INT_HasOccurred(USB_INT_HSOFI)) + if (FrameElapsed) { + FrameElapsed = false; + USB_INT_Clear(USB_INT_DDISCI); break; } -- cgit v1.2.3