X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/8b009bc11375cb81f048c5fb52773c35bf589b67..03ee87b35abdb8b92e8b55ec040fa943f9a6786c:/LUFA/Drivers/USB/Class/Device/HID.h?ds=sidebyside diff --git a/LUFA/Drivers/USB/Class/Device/HID.h b/LUFA/Drivers/USB/Class/Device/HID.h index d51327c39..f62c08c39 100644 --- a/LUFA/Drivers/USB/Class/Device/HID.h +++ b/LUFA/Drivers/USB/Class/Device/HID.h @@ -1,21 +1,21 @@ /* LUFA Library - Copyright (C) Dean Camera, 2009. + Copyright (C) Dean Camera, 2010. dean [at] fourwalledcubicle [dot] com www.fourwalledcubicle.com */ /* - Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) - Permission to use, copy, modify, and distribute this software - and its documentation for any purpose and without fee is hereby - granted, provided that the above copyright notice appear in all - copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaim all warranties with regard to this @@ -89,7 +89,8 @@ */ uint8_t PrevReportINBufferSize; /**< Size in bytes of the given input report buffer. This is used to create a * second buffer of the same size within the driver so that subsequent reports - * can be compared. + * can be compared. If the user app is to determine when reports are to be sent + * exclusively (i.e. \ref PrevReportINBuffer is NULL) this value is ignored. */ } Config; /**< Config data for the USB class interface within the device. All elements in this section * must be set or the interface will fail to enumerate and operate correctly. @@ -130,15 +131,6 @@ */ void HID_Device_USBTask(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1); - /** 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. It is recommended - * that this be called by the \ref EVENT_USB_Device_StartOfFrame() event, once SOF events have been enabled via - * \ref USB_Device_EnableSOFEvents();. - * - * \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) ATTR_NON_NULL_PTR_ARG(1); - /** HID class driver callback for the user creation of a HID IN 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. @@ -172,6 +164,21 @@ const void* ReportData, const uint16_t ReportSize) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3); + /* Inline Functions: */ + /** 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. It is recommended + * that this be called by the \ref EVENT_USB_Device_StartOfFrame() event, once SOF events have been enabled via + * \ref USB_Device_EnableSOFEvents();. + * + * \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state + */ + static inline void HID_Device_MillisecondElapsed(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo); + static inline void HID_Device_MillisecondElapsed(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo) + { + if (HIDInterfaceInfo->State.IdleMSRemaining) + HIDInterfaceInfo->State.IdleMSRemaining--; + } + /* Disable C linkage for C++ Compilers: */ #if defined(__cplusplus) }