diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-07-30 14:35:42 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-07-30 14:35:42 +0000 |
commit | 72932e278000c7086073a28639e3cfae06e39eb3 (patch) | |
tree | 8fd1350e0f1029cdd0dd0ee715be35774f516a97 /LUFA/Drivers/USB/Class/Device/HID.h | |
parent | ec079c71d89913dd4823fe7ecf22d0d3f42b1e6d (diff) | |
download | lufa-72932e278000c7086073a28639e3cfae06e39eb3.tar.gz lufa-72932e278000c7086073a28639e3cfae06e39eb3.tar.bz2 lufa-72932e278000c7086073a28639e3cfae06e39eb3.zip |
Fix to HID device mode Class driver, so that new reports are compared against the old, and updated reports made within the idle period are sent immediately to the host.
Diffstat (limited to 'LUFA/Drivers/USB/Class/Device/HID.h')
-rw-r--r-- | LUFA/Drivers/USB/Class/Device/HID.h | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/LUFA/Drivers/USB/Class/Device/HID.h b/LUFA/Drivers/USB/Class/Device/HID.h index 87f96c680..61f43a141 100644 --- a/LUFA/Drivers/USB/Class/Device/HID.h +++ b/LUFA/Drivers/USB/Class/Device/HID.h @@ -56,6 +56,17 @@ #endif
/* Public Interface - May be used in end-application: */
+ /* Macros: */
+ #if !defined(HID_MAX_REPORT_SIZE)
+ /** Maximum size of an IN report which can be generated by the device and sent to the host, in bytes.
+ *
+ * \note If larger reports than the default specified here are to be generated by the device, this
+ * value can be overridden by defining this token to the required value in the project makefile
+ * and passing it to the compiler via the -D switch.
+ */
+ #define HID_MAX_REPORT_SIZE 16
+ #endif
+
/* Type Defines: */
/** Class state structure. An instance of this structure should be made for each HID interface
* within the user application, and passed to each of the HID class driver functions as the
@@ -68,19 +79,15 @@ uint8_t InterfaceNumber; /**< Interface number of the HID interface within the device */
uint8_t ReportINEndpointNumber; /**< Endpoint number of the HID interface's IN report endpoint */
- uint16_t ReportINEndpointSize; /**< Size in bytes of the HID interface's IN report endpoint */
-
- uint8_t ReportINBufferSize; /**< Size of the largest possible report to send to the host, for
- * buffer allocation purposes
- */
+ uint16_t ReportINEndpointSize; /**< Size in bytes of the HID interface's IN report endpoint */
} Config; /**< Config data for the USB class interface within the device. All elements in this section
* <b>must</b> be set or the interface will fail to enumerate and operate correctly.
*/
struct
{
bool UsingReportProtocol; /**< Indicates if the HID interface is set to Boot or Report protocol mode */
- uint16_t IdleCount; /**< Report idle period, in ms, set by the host */
- uint16_t IdleMSRemaining; /**< Total number of ms remaining before the idle period elapsed - this should be
+ uint16_t IdleCount; /**< Report idle period, in mS, set by the host */
+ uint16_t IdleMSRemaining; /**< Total number of mS remaining before the idle period elapsed - this should be
* decremented by the user application if non-zero each millisecond */
} State; /**< State data for the USB class interface within the device. All elements in this section
* are reset to their defaults when the interface is enumerated.
|