aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/Class
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-09-17 23:34:16 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-09-17 23:34:16 +0000
commitcd0adb7574525978f50eabd536f7563f2d9f9aa7 (patch)
tree6abf76db4c61b4cfddc784b81d6dfd1336f1eacc /LUFA/Drivers/USB/Class
parent7c6b2019a302fb064665c1a69e559678c299e9bb (diff)
downloadlufa-cd0adb7574525978f50eabd536f7563f2d9f9aa7.tar.gz
lufa-cd0adb7574525978f50eabd536f7563f2d9f9aa7.tar.bz2
lufa-cd0adb7574525978f50eabd536f7563f2d9f9aa7.zip
Added support for the officially recommended layout of the external peripherals connected to the BUMBLEB board.
Added flag to the HID Host Class driver to indicate the currently selected reporting protocol.
Diffstat (limited to 'LUFA/Drivers/USB/Class')
-rw-r--r--LUFA/Drivers/USB/Class/Host/HID.c13
-rw-r--r--LUFA/Drivers/USB/Class/Host/HID.h3
2 files changed, 12 insertions, 4 deletions
diff --git a/LUFA/Drivers/USB/Class/Host/HID.c b/LUFA/Drivers/USB/Class/Host/HID.c
index 5a5ec484d..9b1ec161d 100644
--- a/LUFA/Drivers/USB/Class/Host/HID.c
+++ b/LUFA/Drivers/USB/Class/Host/HID.c
@@ -185,10 +185,15 @@ uint8_t USB_HID_Host_SetBootProtocol(USB_ClassInfo_HID_Host_t* HIDInterfaceInfo)
Pipe_SelectPipe(PIPE_CONTROLPIPE);
- if (!(HIDInterfaceInfo->State.SupportsBootSubClass))
+ if (!(HIDInterfaceInfo->State.SupportsBootProtocol))
return HID_ERROR_LOGICAL;
+
+ if ((ErrorCode = USB_Host_SendControlRequest(HIDReportData)) != HOST_SENDCONTROL_Successful)
+ return ErrorCode;
+
+ HIDInterfaceInfo->State.UsingBootProtocol = true;
- return USB_Host_SendControlRequest(NULL);
+ return HOST_SENDCONTROL_Successful;
}
uint8_t USB_HID_Host_SetReportProtocol(USB_ClassInfo_HID_Host_t* HIDInterfaceInfo)
@@ -226,6 +231,8 @@ uint8_t USB_HID_Host_SetReportProtocol(USB_ClassInfo_HID_Host_t* HIDInterfaceInf
if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)
return ErrorCode;
+ HIDInterfaceInfo->State.UsingBootProtocol = false;
+
if (HIDInterfaceInfo->Config.HIDParserData == NULL)
return HID_ERROR_LOGICAL;
@@ -234,7 +241,7 @@ uint8_t USB_HID_Host_SetReportProtocol(USB_ClassInfo_HID_Host_t* HIDInterfaceInf
{
return HID_ERROR_LOGICAL | ErrorCode;
}
-
+
return 0;
}
diff --git a/LUFA/Drivers/USB/Class/Host/HID.h b/LUFA/Drivers/USB/Class/Host/HID.h
index c0f67e752..95c133419 100644
--- a/LUFA/Drivers/USB/Class/Host/HID.h
+++ b/LUFA/Drivers/USB/Class/Host/HID.h
@@ -92,9 +92,10 @@
uint16_t DataINPipeSize; /**< Size in bytes of the HID interface's IN data pipe */
uint16_t DataOUTPipeSize; /**< Size in bytes of the HID interface's OUT data pipe */
- bool SupportsBootSubClass; /**< Indicates if the current interface instance supports the HID Boot
+ bool SupportsBootProtocol; /**< Indicates if the current interface instance supports the HID Boot
* Protocol when enabled via \ref USB_HID_Host_SetBootProtocol()
*/
+ bool UsingBootProtocol; /**< Indicates that the interface is currently initialised in Boot Protocol mode */
uint16_t HIDReportSize; /**< Size in bytes of the HID report descriptor in the device */
} State; /**< State data for the USB class interface within the device. All elements in this section
* <b>may</b> be set to initial values, but may also be ignored to default to sane values when