diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-04-14 08:35:47 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-04-14 08:35:47 +0000 |
commit | 6a5a37d7d141f109dc02d0bb6d8f4757b533408d (patch) | |
tree | 6ec5a4528b25d8531d508348caa8f297d3aa5b1d /LUFA | |
parent | fea5d085122bb386f1ec293b2e51036e29c7dc30 (diff) | |
download | lufa-6a5a37d7d141f109dc02d0bb6d8f4757b533408d.tar.gz lufa-6a5a37d7d141f109dc02d0bb6d8f4757b533408d.tar.bz2 lufa-6a5a37d7d141f109dc02d0bb6d8f4757b533408d.zip |
The USB_Host_SendControlRequest() function no longer automatically selects the Control pipe (pipe 0), so that other control type pipes can be used with the function.
The USB Host management task now saves and restores the currently selected pipe before and after the task completes.
Diffstat (limited to 'LUFA')
-rw-r--r-- | LUFA/ChangeLog.txt | 3 | ||||
-rw-r--r-- | LUFA/Drivers/USB/Class/ConfigDescriptor.c | 2 | ||||
-rw-r--r-- | LUFA/Drivers/USB/HighLevel/USBTask.c | 6 | ||||
-rw-r--r-- | LUFA/Drivers/USB/LowLevel/HostChapter9.c | 1 | ||||
-rw-r--r-- | LUFA/Drivers/USB/LowLevel/HostChapter9.h | 2 | ||||
-rw-r--r-- | LUFA/MigrationInformation.txt | 6 |
6 files changed, 18 insertions, 2 deletions
diff --git a/LUFA/ChangeLog.txt b/LUFA/ChangeLog.txt index 78f1ec747..80436f66a 100644 --- a/LUFA/ChangeLog.txt +++ b/LUFA/ChangeLog.txt @@ -31,6 +31,9 @@ * - Fixed WriteNextReport code in the GenericHIDHost demo using incorrect parameter types and not selecting the correct endpoint
* - Adjusted sample CTC timer calculations in the AudioOutput and AudioInput demos to account for situations where the division results
* in a value with no remainder, requiring one to be subtracted from the result (thanks to Robin Theunis)
+ * - The USB_Host_SendControlRequest() function no longer automatically selects the Control pipe (pipe 0), so that other control type
+ * pipes can be used with the function
+ * - The USB Host management task now saves and restores the currently selected pipe before and after the task completes
*
* \section Sec_ChangeLog090401 Version 090401
*
diff --git a/LUFA/Drivers/USB/Class/ConfigDescriptor.c b/LUFA/Drivers/USB/Class/ConfigDescriptor.c index d79106916..f22426bf0 100644 --- a/LUFA/Drivers/USB/Class/ConfigDescriptor.c +++ b/LUFA/Drivers/USB/Class/ConfigDescriptor.c @@ -43,6 +43,8 @@ uint8_t USB_Host_GetDeviceConfigDescriptor(uint16_t* const ConfigSizePtr, void* wLength: sizeof(USB_Descriptor_Configuration_Header_t),
};
+ Pipe_SelectPipe(PIPE_CONTROLPIPE);
+
if (BufferPtr == NULL)
{
uint8_t ConfigHeader[sizeof(USB_Descriptor_Configuration_Header_t)];
diff --git a/LUFA/Drivers/USB/HighLevel/USBTask.c b/LUFA/Drivers/USB/HighLevel/USBTask.c index 395f2d25e..e62ac687f 100644 --- a/LUFA/Drivers/USB/HighLevel/USBTask.c +++ b/LUFA/Drivers/USB/HighLevel/USBTask.c @@ -86,6 +86,10 @@ static void USB_HostTask(void) static uint16_t WaitMSRemaining;
static uint8_t PostWaitState;
+ uint8_t PrevPipe = Pipe_GetCurrentPipe();
+
+ Pipe_SelectPipe(PIPE_CONTROLPIPE);
+
switch (USB_HostState)
{
case HOST_STATE_WaitForDevice:
@@ -249,5 +253,7 @@ static void USB_HostTask(void) USB_ResetInterface();
}
+
+ Pipe_SelectPipe(PrevPipe);
}
#endif
diff --git a/LUFA/Drivers/USB/LowLevel/HostChapter9.c b/LUFA/Drivers/USB/LowLevel/HostChapter9.c index 123a1d25f..5367c984c 100644 --- a/LUFA/Drivers/USB/LowLevel/HostChapter9.c +++ b/LUFA/Drivers/USB/LowLevel/HostChapter9.c @@ -50,7 +50,6 @@ uint8_t USB_Host_SendControlRequest(void* BufferPtr) if ((ReturnStatus = USB_Host_WaitMS(1)) != HOST_WAITERROR_Successful)
return ReturnStatus;
- Pipe_SelectPipe(PIPE_CONTROLPIPE);
Pipe_SetToken(PIPE_TOKEN_SETUP);
Pipe_ClearErrorFlags();
Pipe_ClearSetupSent();
diff --git a/LUFA/Drivers/USB/LowLevel/HostChapter9.h b/LUFA/Drivers/USB/LowLevel/HostChapter9.h index 84ee8ae8a..7ced889b3 100644 --- a/LUFA/Drivers/USB/LowLevel/HostChapter9.h +++ b/LUFA/Drivers/USB/LowLevel/HostChapter9.h @@ -95,7 +95,7 @@ /* Function Prototypes: */
/** Sends the request stored in the USB_HostRequest global structure to the attached device,
* and transfers the data stored in the buffer to the device, or from the device to the buffer
- * as requested.
+ * as requested. The transfer is made on the currently selected pipe.
*
* \param BufferPtr Pointer to the start of the data buffer if the request has a data stage, or
* NULL if the request transfers no data to or from the device.
diff --git a/LUFA/MigrationInformation.txt b/LUFA/MigrationInformation.txt index 9aa3b0005..49fa25dea 100644 --- a/LUFA/MigrationInformation.txt +++ b/LUFA/MigrationInformation.txt @@ -12,6 +12,12 @@ *
* \section Sec_MigrationXXXXXX Migrating from 090401 to XXXXXX
*
+ * <b>Host Mode</b>
+ * - The USB_Host_SendControlRequest() function no longer automatically selects the Control pipe (pipe 0) to allow it to be used on
+ * other control type pipes. Care should be taken to ensure that the Control pipe is always selected before the function is called
+ * in existing projects where the Control pipe is to be operated on.
+ * - The USB Host management task now saves and restores the currently selected pipe before and after the task runs. Projects no longer
+ * need to manage this manually when calling the USB management task.
*
* \section Sec_Migration090401 Migrating from 090209 to 090401
*
|