aboutsummaryrefslogtreecommitdiff
path: root/Demos/Device
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 /Demos/Device
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 'Demos/Device')
-rw-r--r--Demos/Device/ClassDriver/DualCDC/DualCDC.c5
-rw-r--r--Demos/Device/ClassDriver/GenericHID/GenericHID.c3
-rw-r--r--Demos/Device/ClassDriver/Joystick/Joystick.c3
-rw-r--r--Demos/Device/ClassDriver/Keyboard/Keyboard.c3
-rw-r--r--Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c14
-rw-r--r--Demos/Device/ClassDriver/Mouse/Mouse.c3
6 files changed, 7 insertions, 24 deletions
diff --git a/Demos/Device/ClassDriver/DualCDC/DualCDC.c b/Demos/Device/ClassDriver/DualCDC/DualCDC.c
index 9e3217cf..82ed59d5 100644
--- a/Demos/Device/ClassDriver/DualCDC/DualCDC.c
+++ b/Demos/Device/ClassDriver/DualCDC/DualCDC.c
@@ -78,11 +78,6 @@ USB_ClassInfo_CDC_Device_t VirtualSerial2_CDC_Interface =
.NotificationEndpointNumber = CDC2_NOTIFICATION_EPNUM,
.NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE,
},
-
- .State =
- {
- // Leave all state values to their defaults
- }
};
/** Main program entry point. This routine contains the overall program flow, including initial
diff --git a/Demos/Device/ClassDriver/GenericHID/GenericHID.c b/Demos/Device/ClassDriver/GenericHID/GenericHID.c
index b04f7af7..4315723f 100644
--- a/Demos/Device/ClassDriver/GenericHID/GenericHID.c
+++ b/Demos/Device/ClassDriver/GenericHID/GenericHID.c
@@ -118,8 +118,7 @@ void EVENT_USB_UnhandledControlPacket(void)
/** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */
ISR(TIMER0_COMPA_vect, ISR_BLOCK)
{
- if (Generic_HID_Interface.State.IdleMSRemaining)
- Generic_HID_Interface.State.IdleMSRemaining--;
+ HID_Device_MillisecondElapsed(&Generic_HID_Interface);
}
/** HID class driver callback function for the creation of HID reports to the host.
diff --git a/Demos/Device/ClassDriver/Joystick/Joystick.c b/Demos/Device/ClassDriver/Joystick/Joystick.c
index d9ff6ca9..ffd167ef 100644
--- a/Demos/Device/ClassDriver/Joystick/Joystick.c
+++ b/Demos/Device/ClassDriver/Joystick/Joystick.c
@@ -120,8 +120,7 @@ void EVENT_USB_UnhandledControlPacket(void)
/** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */
ISR(TIMER0_COMPA_vect, ISR_BLOCK)
{
- if (Joystick_HID_Interface.State.IdleMSRemaining)
- Joystick_HID_Interface.State.IdleMSRemaining--;
+ HID_Device_MillisecondElapsed(&Joystick_HID_Interface);
}
/** HID class driver callback function for the creation of HID reports to the host.
diff --git a/Demos/Device/ClassDriver/Keyboard/Keyboard.c b/Demos/Device/ClassDriver/Keyboard/Keyboard.c
index cd8c3e69..fb19d02d 100644
--- a/Demos/Device/ClassDriver/Keyboard/Keyboard.c
+++ b/Demos/Device/ClassDriver/Keyboard/Keyboard.c
@@ -121,8 +121,7 @@ void EVENT_USB_UnhandledControlPacket(void)
/** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */
ISR(TIMER0_COMPA_vect, ISR_BLOCK)
{
- if (Keyboard_HID_Interface.State.IdleMSRemaining)
- Keyboard_HID_Interface.State.IdleMSRemaining--;
+ HID_Device_MillisecondElapsed(&Keyboard_HID_Interface);
}
/** HID class driver callback function for the creation of HID reports to the host.
diff --git a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c
index 45a2c527..418ccba4 100644
--- a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c
+++ b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c
@@ -66,12 +66,7 @@ USB_ClassInfo_HID_Device_t Mouse_HID_Interface =
.ReportINEndpointNumber = MOUSE_IN_EPNUM,
.ReportINEndpointSize = HID_EPSIZE,
- },
-
- .State =
- {
- // Leave all state values to their defaults
- }
+ },
};
/** Main program entry point. This routine contains the overall program flow, including initial
@@ -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. */
ISR(TIMER0_COMPA_vect, ISR_BLOCK)
{
- if (Keyboard_HID_Interface.State.IdleMSRemaining)
- Keyboard_HID_Interface.State.IdleMSRemaining--;
-
- if (Mouse_HID_Interface.State.IdleMSRemaining)
- Mouse_HID_Interface.State.IdleMSRemaining--;
+ HID_Device_MillisecondElapsed(&Keyboard_HID_Interface);
+ HID_Device_MillisecondElapsed(&Mouse_HID_Interface);
}
/** HID class driver callback function for the creation of HID reports to the host.
diff --git a/Demos/Device/ClassDriver/Mouse/Mouse.c b/Demos/Device/ClassDriver/Mouse/Mouse.c
index 44894340..51021c0f 100644
--- a/Demos/Device/ClassDriver/Mouse/Mouse.c
+++ b/Demos/Device/ClassDriver/Mouse/Mouse.c
@@ -120,8 +120,7 @@ void EVENT_USB_UnhandledControlPacket(void)
/** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */
ISR(TIMER0_COMPA_vect, ISR_BLOCK)
{
- if (Mouse_HID_Interface.State.IdleMSRemaining)
- Mouse_HID_Interface.State.IdleMSRemaining--;
+ HID_Device_MillisecondElapsed(&Mouse_HID_Interface);
}
/** HID class driver callback function for the creation of HID reports to the host.