aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/MouseFullInt
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-03-09 11:50:43 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-03-09 11:50:43 +0000
commitb0d9f961acfff498b7c4f2dc4a54ad9513d09a3b (patch)
tree6862e7c91dbc6763bc2dc199dbccdc4c4b98a15f /Demos/MouseFullInt
parentd711e37d2f10f8df9a9ffdf974935c1f1d0a7906 (diff)
downloadlufa-b0d9f961acfff498b7c4f2dc4a54ad9513d09a3b.tar.gz
lufa-b0d9f961acfff498b7c4f2dc4a54ad9513d09a3b.tar.bz2
lufa-b0d9f961acfff498b7c4f2dc4a54ad9513d09a3b.zip
Fixed interrupt driven HID device demos not clearing the interrupt flags in all circumstances.
Diffstat (limited to 'Demos/MouseFullInt')
-rw-r--r--Demos/MouseFullInt/MouseFullInt.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/Demos/MouseFullInt/MouseFullInt.c b/Demos/MouseFullInt/MouseFullInt.c
index c21959a2c..28267a14f 100644
--- a/Demos/MouseFullInt/MouseFullInt.c
+++ b/Demos/MouseFullInt/MouseFullInt.c
@@ -358,6 +358,15 @@ ISR(ENDPOINT_PIPE_vect, ISR_BLOCK)
USB_MouseReport_Data_t MouseReportData;
bool SendReport = true;
+ /* Select the Mouse Report Endpoint */
+ Endpoint_SelectEndpoint(MOUSE_EPNUM);
+
+ /* Clear the endpoint IN interrupt flag */
+ USB_INT_Clear(ENDPOINT_INT_IN);
+
+ /* Clear the Mouse Report endpoint interrupt and select the endpoint */
+ Endpoint_ClearEndpointInterrupt(MOUSE_EPNUM);
+
/* Create the next mouse report for transmission to the host */
GetNextReport(&MouseReportData);
@@ -380,20 +389,11 @@ ISR(ENDPOINT_PIPE_vect, ISR_BLOCK)
/* Check to see if a report should be issued */
if (SendReport)
{
- /* Select the Mouse Report Endpoint */
- Endpoint_SelectEndpoint(MOUSE_EPNUM);
-
- /* Clear the endpoint IN interrupt flag */
- USB_INT_Clear(ENDPOINT_INT_IN);
-
- /* Clear the Mouse Report endpoint interrupt and select the endpoint */
- Endpoint_ClearEndpointInterrupt(MOUSE_EPNUM);
-
/* Write Mouse Report Data */
Endpoint_Write_Stream_LE(&MouseReportData, sizeof(MouseReportData));
-
- /* Finalize the stream transfer to send the last packet */
- Endpoint_ClearCurrentBank();
}
+
+ /* Finalize the stream transfer to send the last packet */
+ Endpoint_ClearCurrentBank();
}
}