aboutsummaryrefslogtreecommitdiff
path: root/LUFA/Drivers
diff options
context:
space:
mode:
authorDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2009-07-30 14:59:57 +0000
committerDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2009-07-30 14:59:57 +0000
commit4e176fdd1a010ffc8625d0cfca7d5d4976e69303 (patch)
tree793ba54650d14eaeb2c262e8d48e4c06f5fd79ac /LUFA/Drivers
parent16bdb1ab38c2d5a149c92244f57c0d573aa3975e (diff)
Add new HID_Device_MillisecondElapsed() function to the HID device Class driver, to move the burden of managing the Idle period of each instance to the library and not the user application.
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@706 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'LUFA/Drivers')
-rw-r--r--LUFA/Drivers/USB/Class/Device/HID.c6
-rw-r--r--LUFA/Drivers/USB/Class/Device/HID.h7
2 files changed, 13 insertions, 0 deletions
diff --git a/LUFA/Drivers/USB/Class/Device/HID.c b/LUFA/Drivers/USB/Class/Device/HID.c
index bfe97ffb..eef15f26 100644
--- a/LUFA/Drivers/USB/Class/Device/HID.c
+++ b/LUFA/Drivers/USB/Class/Device/HID.c
@@ -184,4 +184,10 @@ void HID_Device_USBTask(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)
}
}
+void HID_Device_MillisecondElapsed(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo)
+{
+ if (HIDInterfaceInfo->State.IdleMSRemaining)
+ HIDInterfaceInfo->State.IdleMSRemaining--;
+}
+
#endif
diff --git a/LUFA/Drivers/USB/Class/Device/HID.h b/LUFA/Drivers/USB/Class/Device/HID.h
index ae68134f..06456cf8 100644
--- a/LUFA/Drivers/USB/Class/Device/HID.h
+++ b/LUFA/Drivers/USB/Class/Device/HID.h
@@ -121,6 +121,13 @@
*/
void HID_Device_USBTask(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo);
+ /** Indicates that a millisecond of idle time has elapsed on the given HID interface, and the interface's idle count should be
+ * decremented. This should be called once per millisecond so that hardware key-repeats function correctly.
+ *
+ * \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state.
+ */
+ void HID_Device_MillisecondElapsed(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo);
+
/** HID class driver callback for the user creation of a HID input report. This callback may fire in response to either
* HID class control requests from the host, or by the normal HID endpoint polling procedure. Inside this callback the
* user is responsible for the creation of the next HID input report to be sent to the host.