aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Host
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-04-01 07:43:50 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-04-01 07:43:50 +0000
commitece9e3d5991dd481fc36baf799a1a85d14b88251 (patch)
treea659f9bd537f05ddf841106f2ed94e1f4e0f5bbe /Demos/Host
parent6198289b388e4122afe4913f899b37a8e7cd8af4 (diff)
downloadlufa-ece9e3d5991dd481fc36baf799a1a85d14b88251.tar.gz
lufa-ece9e3d5991dd481fc36baf799a1a85d14b88251.tar.bz2
lufa-ece9e3d5991dd481fc36baf799a1a85d14b88251.zip
Changed GenericHID device demo to use the LUFA scheduler, added INTERRUPT_DATA_ENDPOINT and INTERRUPT_CONTROL_ENDPOINT compile time options.
Diffstat (limited to 'Demos/Host')
-rw-r--r--Demos/Host/GenericHIDHost/GenericHIDHost.c6
-rw-r--r--Demos/Host/KeyboardHost/KeyboardHost.c6
-rw-r--r--Demos/Host/MouseHost/MouseHost.c6
3 files changed, 18 insertions, 0 deletions
diff --git a/Demos/Host/GenericHIDHost/GenericHIDHost.c b/Demos/Host/GenericHIDHost/GenericHIDHost.c
index 625ca7023..c703039f3 100644
--- a/Demos/Host/GenericHIDHost/GenericHIDHost.c
+++ b/Demos/Host/GenericHIDHost/GenericHIDHost.c
@@ -350,6 +350,9 @@ TASK(USB_HID_Host)
*/
ISR(ENDPOINT_PIPE_vect, ISR_BLOCK)
{
+ /* Save previously selected pipe before selecting a new pipe */
+ uint8_t PrevSelectedPipe = Pipe_GetCurrentPipe();
+
/* Check to see if the HID data IN pipe has caused the interrupt */
if (Pipe_HasPipeInterrupted(HID_DATA_IN_PIPE))
{
@@ -367,5 +370,8 @@ ISR(ENDPOINT_PIPE_vect, ISR_BLOCK)
ReadNextReport();
}
}
+
+ /* Restore previously selected pipe */
+ Pipe_SelectPipe(PrevSelectedPipe);
}
#endif
diff --git a/Demos/Host/KeyboardHost/KeyboardHost.c b/Demos/Host/KeyboardHost/KeyboardHost.c
index fe95c3493..13aed7ec3 100644
--- a/Demos/Host/KeyboardHost/KeyboardHost.c
+++ b/Demos/Host/KeyboardHost/KeyboardHost.c
@@ -350,6 +350,9 @@ TASK(USB_Keyboard_Host)
*/
ISR(ENDPOINT_PIPE_vect, ISR_BLOCK)
{
+ /* Save previously selected pipe before selecting a new pipe */
+ uint8_t PrevSelectedPipe = Pipe_GetCurrentPipe();
+
/* Check to see if the keyboard data pipe has caused the interrupt */
if (Pipe_HasPipeInterrupted(KEYBOARD_DATAPIPE))
{
@@ -366,5 +369,8 @@ ISR(ENDPOINT_PIPE_vect, ISR_BLOCK)
/* Read and process the next report from the device */
ReadNextReport();
}
+
+ /* Restore previously selected pipe */
+ Pipe_SelectPipe(PrevSelectedPipe);
}
#endif
diff --git a/Demos/Host/MouseHost/MouseHost.c b/Demos/Host/MouseHost/MouseHost.c
index dda4d6217..dd7ff73f0 100644
--- a/Demos/Host/MouseHost/MouseHost.c
+++ b/Demos/Host/MouseHost/MouseHost.c
@@ -346,6 +346,9 @@ TASK(USB_Mouse_Host)
*/
ISR(ENDPOINT_PIPE_vect, ISR_BLOCK)
{
+ /* Save previously selected pipe before selecting a new pipe */
+ uint8_t PrevSelectedPipe = Pipe_GetCurrentPipe();
+
/* Check to see if the mouse data pipe has caused the interrupt */
if (Pipe_HasPipeInterrupted(MOUSE_DATAPIPE))
{
@@ -363,5 +366,8 @@ ISR(ENDPOINT_PIPE_vect, ISR_BLOCK)
ReadNextReport();
}
}
+
+ /* Restore previously selected pipe */
+ Pipe_SelectPipe(PrevSelectedPipe);
}
#endif