X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/d860e9e842c05e759214f5170f78783decae9956..1f83abe6f42c302cf3af7e16e5bb02d886a2c82a:/LUFA/Drivers/USB/HighLevel/USBTask.c diff --git a/LUFA/Drivers/USB/HighLevel/USBTask.c b/LUFA/Drivers/USB/HighLevel/USBTask.c index aa04c56ba..5202cc834 100644 --- a/LUFA/Drivers/USB/HighLevel/USBTask.c +++ b/LUFA/Drivers/USB/HighLevel/USBTask.c @@ -83,12 +83,11 @@ static void USB_HostTask(void) { uint8_t ErrorCode = HOST_ENUMERROR_NoError; uint8_t SubErrorCode = HOST_ENUMERROR_NoError; + uint8_t PrevPipe = Pipe_GetCurrentPipe(); static uint16_t WaitMSRemaining; static uint8_t PostWaitState; - uint8_t PrevPipe = Pipe_GetCurrentPipe(); - Pipe_SelectPipe(PIPE_CONTROLPIPE); switch (USB_HostState) @@ -157,7 +156,7 @@ static void USB_HostTask(void) break; case HOST_STATE_Powered: Pipe_ConfigurePipe(PIPE_CONTROLPIPE, EP_TYPE_CONTROL, - PIPE_TOKEN_SETUP, PIPE_CONTROLPIPE, + PIPE_TOKEN_SETUP, ENDPOINT_CONTROLEP, PIPE_CONTROLPIPE_DEFAULT_SIZE, PIPE_BANK_SINGLE); if (!(Pipe_IsConfigured())) @@ -176,10 +175,10 @@ static void USB_HostTask(void) .bRequest = REQ_GetDescriptor, .wValue = (DTYPE_Device << 8), .wIndex = 0, - .wLength = PIPE_CONTROLPIPE_DEFAULT_SIZE, + .wLength = 8, }; - uint8_t DataBuffer[PIPE_CONTROLPIPE_DEFAULT_SIZE]; + uint8_t DataBuffer[8]; if ((SubErrorCode = USB_Host_SendControlRequest(DataBuffer)) != HOST_SENDCONTROL_Successful) { @@ -203,7 +202,7 @@ static void USB_HostTask(void) Pipe_ResetPipe(PIPE_CONTROLPIPE); Pipe_ConfigurePipe(PIPE_CONTROLPIPE, EP_TYPE_CONTROL, - PIPE_TOKEN_SETUP, PIPE_CONTROLPIPE, + PIPE_TOKEN_SETUP, ENDPOINT_CONTROLEP, USB_ControlPipeSize, PIPE_BANK_SINGLE); if (!(Pipe_IsConfigured()))