Add new HID_Device_MillisecondElapsed() function to the HID device Class driver,...
[pub/USBasp.git] / Demos / Device / ClassDriver / KeyboardMouse / KeyboardMouse.c
index 45a2c52..418ccba 100644 (file)
@@ -66,12 +66,7 @@ USB_ClassInfo_HID_Device_t Mouse_HID_Interface =
 \r
                                .ReportINEndpointNumber  = MOUSE_IN_EPNUM,\r
                                .ReportINEndpointSize    = HID_EPSIZE,\r
-                       },\r
-                       \r
-               .State =\r
-                       {\r
-                               // Leave all state values to their defaults\r
-                       }                       \r
+                       },              \r
        };\r
 \r
 /** Main program entry point. This routine contains the overall program flow, including initial\r
@@ -147,11 +142,8 @@ void EVENT_USB_UnhandledControlPacket(void)
 /** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */\r
 ISR(TIMER0_COMPA_vect, ISR_BLOCK)\r
 {\r
-       if (Keyboard_HID_Interface.State.IdleMSRemaining)\r
-         Keyboard_HID_Interface.State.IdleMSRemaining--;\r
-\r
-       if (Mouse_HID_Interface.State.IdleMSRemaining)\r
-         Mouse_HID_Interface.State.IdleMSRemaining--;\r
+       HID_Device_MillisecondElapsed(&Keyboard_HID_Interface);\r
+       HID_Device_MillisecondElapsed(&Mouse_HID_Interface);\r
 }\r
 \r
 /** HID class driver callback function for the creation of HID reports to the host.\r