projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove MIDI ClassDriver device demo's accidental inclusion of the unused ADC peripher...
[pub/USBasp.git]
/
LUFA
/
Drivers
/
USB
/
LowLevel
/
Host.c
diff --git
a/LUFA/Drivers/USB/LowLevel/Host.c
b/LUFA/Drivers/USB/LowLevel/Host.c
index
f00e6dd
..
1d7faa1
100644
(file)
--- a/
LUFA/Drivers/USB/LowLevel/Host.c
+++ b/
LUFA/Drivers/USB/LowLevel/Host.c
@@
-199,6
+199,11
@@
uint8_t USB_Host_WaitMS(uint8_t MS)
USB_Host_ResumeBus();
USB_Host_ResumeBus();
+ bool HSOFIEnabled = USB_INT_IsEnabled(USB_INT_HSOFI);
+
+ USB_INT_Disable(USB_INT_HSOFI);
+ USB_INT_Clear(USB_INT_HSOFI);
+
while (MS)
{
if (USB_INT_HasOccurred(USB_INT_HSOFI))
while (MS)
{
if (USB_INT_HasOccurred(USB_INT_HSOFI))
@@
-231,6
+236,9
@@
uint8_t USB_Host_WaitMS(uint8_t MS)
}
}
}
}
+ if (HSOFIEnabled)
+ USB_INT_Enable(USB_INT_HSOFI);
+
if (BusSuspended)
USB_Host_SuspendBus();
if (BusSuspended)
USB_Host_SuspendBus();
@@
-245,11
+253,13
@@
static void USB_Host_ResetDevice(void)
USB_Host_ResetBus();
while (!(USB_Host_IsBusResetComplete()));
USB_Host_ResetBus();
while (!(USB_Host_IsBusResetComplete()));
-
USB_Host_ResumeBus();
USB_Host_ResumeBus();
-
USB_INT_Clear
(USB_INT_HSOFI);
+
bool HSOFIEnabled = USB_INT_IsEnabled
(USB_INT_HSOFI);
+ USB_INT_Disable(USB_INT_HSOFI);
+ USB_INT_Clear(USB_INT_HSOFI);
+
for (uint8_t MSRem = 10; MSRem != 0; MSRem--)
{
/* Workaround for powerless-pull-up devices. After a USB bus reset,
for (uint8_t MSRem = 10; MSRem != 0; MSRem--)
{
/* Workaround for powerless-pull-up devices. After a USB bus reset,
@@
-267,6
+277,9
@@
static void USB_Host_ResetDevice(void)
_delay_ms(1);
}
_delay_ms(1);
}
+ if (HSOFIEnabled)
+ USB_INT_Enable(USB_INT_HSOFI);
+
if (BusSuspended)
USB_Host_SuspendBus();
if (BusSuspended)
USB_Host_SuspendBus();
@@
-305,7
+318,9
@@
uint8_t USB_Host_GetDeviceDescriptor(void* const DeviceDescriptorPtr)
return USB_Host_SendControlRequest(DeviceDescriptorPtr);
}
return USB_Host_SendControlRequest(DeviceDescriptorPtr);
}
-uint8_t USB_Host_GetDeviceStringDescriptor(const uint8_t Index, void* const Buffer, const uint8_t BufferLength)
+uint8_t USB_Host_GetDeviceStringDescriptor(const uint8_t Index,
+ void* const Buffer,
+ const uint8_t BufferLength)
{
USB_ControlRequest = (USB_Request_Header_t)
{
{
USB_ControlRequest = (USB_Request_Header_t)
{
@@
-323,9
+338,6
@@
uint8_t USB_Host_GetDeviceStringDescriptor(const uint8_t Index, void* const Buff
uint8_t USB_Host_ClearPipeStall(uint8_t EndpointNum)
{
uint8_t USB_Host_ClearPipeStall(uint8_t EndpointNum)
{
- if (Pipe_GetPipeToken() == PIPE_TOKEN_IN)
- EndpointNum |= ENDPOINT_DESCRIPTOR_DIR_IN;
-
USB_ControlRequest = (USB_Request_Header_t)
{
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_ENDPOINT),
USB_ControlRequest = (USB_Request_Header_t)
{
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_ENDPOINT),