X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/a925407588726cf6c0587e932b56b3b6257529e0..42cfd157936571c70b6ba0be48fbda1ab7b450a1:/LUFA/Drivers/USB/LowLevel/Host.c diff --git a/LUFA/Drivers/USB/LowLevel/Host.c b/LUFA/Drivers/USB/LowLevel/Host.c index b83c51404..e10d34781 100644 --- a/LUFA/Drivers/USB/LowLevel/Host.c +++ b/LUFA/Drivers/USB/LowLevel/Host.c @@ -66,7 +66,7 @@ void USB_Host_ProcessNextHostState(void) USB_HostState = HOST_STATE_Powered_WaitForDeviceSettle; break; case HOST_STATE_Powered_WaitForDeviceSettle: - if (!(WaitMSRemaining--)) + if (WaitMSRemaining--) { _delay_ms(1); break; @@ -308,6 +308,22 @@ uint8_t USB_Host_GetDeviceDescriptor(void* const DeviceDescriptorPtr) return USB_Host_SendControlRequest(DeviceDescriptorPtr); } +uint8_t USB_Host_GetDeviceStringDescriptor(uint8_t Index, void* const Buffer, uint8_t BufferLength) +{ + USB_ControlRequest = (USB_Request_Header_t) + { + bmRequestType: (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE), + bRequest: REQ_GetDescriptor, + wValue: (DTYPE_String << 8) | Index, + wIndex: 0, + wLength: BufferLength, + }; + + Pipe_SelectPipe(PIPE_CONTROLPIPE); + + return USB_Host_SendControlRequest(Buffer); +} + uint8_t USB_Host_ClearPipeStall(uint8_t EndpointNum) { if (Pipe_GetPipeToken() == PIPE_TOKEN_IN)