diff options
| author | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2012-02-26 15:01:36 +0000 |
|---|---|---|
| committer | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2012-02-26 15:01:36 +0000 |
| commit | e2e5146bf7de40eab4012b08c2565d9cd2a704ef (patch) | |
| tree | b5827b3f240e8521facd7acff0e9ee43790b5ff9 /LUFA/Drivers/USB | |
| parent | e8305fe2dc93d7261624948eaad72b241f7bd940 (diff) | |
Fixed possible enumeration error if the user application selects the non-Control pipe between the Powered and Default states of the host state machine.
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@2072 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'LUFA/Drivers/USB')
| -rw-r--r-- | LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c | 17 | ||||
| -rw-r--r-- | LUFA/Drivers/USB/Core/UC3/Host_UC3.c | 17 |
2 files changed, 14 insertions, 20 deletions
diff --git a/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c b/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c index 6d7e9688..fd311e33 100644 --- a/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c +++ b/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c @@ -111,11 +111,9 @@ void USB_Host_ProcessNextHostState(void) HOST_TASK_NONBLOCK_WAIT(200, HOST_STATE_Powered_ConfigPipe); break; case HOST_STATE_Powered_ConfigPipe: - Pipe_ConfigurePipe(PIPE_CONTROLPIPE, EP_TYPE_CONTROL, - PIPE_TOKEN_SETUP, ENDPOINT_CONTROLEP, - PIPE_CONTROLPIPE_DEFAULT_SIZE, PIPE_BANK_SINGLE); - - if (!(Pipe_IsConfigured())) + if (!(Pipe_ConfigurePipe(PIPE_CONTROLPIPE, EP_TYPE_CONTROL, + PIPE_TOKEN_SETUP, ENDPOINT_CONTROLEP, + PIPE_CONTROLPIPE_DEFAULT_SIZE, PIPE_BANK_SINGLE))) { ErrorCode = HOST_ENUMERROR_PipeConfigError; SubErrorCode = 0; @@ -136,6 +134,7 @@ void USB_Host_ProcessNextHostState(void) uint8_t DataBuffer[8]; + Pipe_SelectPipe(PIPE_CONTROLPIPE); if ((SubErrorCode = USB_Host_SendControlRequest(DataBuffer)) != HOST_SENDCONTROL_Successful) { ErrorCode = HOST_ENUMERROR_ControlError; @@ -149,11 +148,9 @@ void USB_Host_ProcessNextHostState(void) HOST_TASK_NONBLOCK_WAIT(200, HOST_STATE_Default_PostReset); break; case HOST_STATE_Default_PostReset: - Pipe_ConfigurePipe(PIPE_CONTROLPIPE, EP_TYPE_CONTROL, - PIPE_TOKEN_SETUP, ENDPOINT_CONTROLEP, - USB_Host_ControlPipeSize, PIPE_BANK_SINGLE); - - if (!(Pipe_IsConfigured())) + if (!(Pipe_ConfigurePipe(PIPE_CONTROLPIPE, EP_TYPE_CONTROL, + PIPE_TOKEN_SETUP, ENDPOINT_CONTROLEP, + USB_Host_ControlPipeSize, PIPE_BANK_SINGLE))) { ErrorCode = HOST_ENUMERROR_PipeConfigError; SubErrorCode = 0; diff --git a/LUFA/Drivers/USB/Core/UC3/Host_UC3.c b/LUFA/Drivers/USB/Core/UC3/Host_UC3.c index 9d302661..ef47b604 100644 --- a/LUFA/Drivers/USB/Core/UC3/Host_UC3.c +++ b/LUFA/Drivers/USB/Core/UC3/Host_UC3.c @@ -111,11 +111,9 @@ void USB_Host_ProcessNextHostState(void) HOST_TASK_NONBLOCK_WAIT(200, HOST_STATE_Powered_ConfigPipe); break; case HOST_STATE_Powered_ConfigPipe: - Pipe_ConfigurePipe(PIPE_CONTROLPIPE, EP_TYPE_CONTROL, - PIPE_TOKEN_SETUP, ENDPOINT_CONTROLEP, - PIPE_CONTROLPIPE_DEFAULT_SIZE, PIPE_BANK_SINGLE); - - if (!(Pipe_IsConfigured())) + if (!(Pipe_ConfigurePipe(PIPE_CONTROLPIPE, EP_TYPE_CONTROL, + PIPE_TOKEN_SETUP, ENDPOINT_CONTROLEP, + PIPE_CONTROLPIPE_DEFAULT_SIZE, PIPE_BANK_SINGLE))) { ErrorCode = HOST_ENUMERROR_PipeConfigError; SubErrorCode = 0; @@ -136,6 +134,7 @@ void USB_Host_ProcessNextHostState(void) uint8_t DataBuffer[8]; + Pipe_SelectPipe(PIPE_CONTROLPIPE); if ((SubErrorCode = USB_Host_SendControlRequest(DataBuffer)) != HOST_SENDCONTROL_Successful) { ErrorCode = HOST_ENUMERROR_ControlError; @@ -149,11 +148,9 @@ void USB_Host_ProcessNextHostState(void) HOST_TASK_NONBLOCK_WAIT(200, HOST_STATE_Default_PostReset); break; case HOST_STATE_Default_PostReset: - Pipe_ConfigurePipe(PIPE_CONTROLPIPE, EP_TYPE_CONTROL, - PIPE_TOKEN_SETUP, ENDPOINT_CONTROLEP, - USB_Host_ControlPipeSize, PIPE_BANK_SINGLE); - - if (!(Pipe_IsConfigured())) + if (!(Pipe_ConfigurePipe(PIPE_CONTROLPIPE, EP_TYPE_CONTROL, + PIPE_TOKEN_SETUP, ENDPOINT_CONTROLEP, + USB_Host_ControlPipeSize, PIPE_BANK_SINGLE))) { ErrorCode = HOST_ENUMERROR_PipeConfigError; SubErrorCode = 0; |
