diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-03-09 11:50:43 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-03-09 11:50:43 +0000 |
commit | b0d9f961acfff498b7c4f2dc4a54ad9513d09a3b (patch) | |
tree | 6862e7c91dbc6763bc2dc199dbccdc4c4b98a15f /Demos/KeyboardFullInt | |
parent | d711e37d2f10f8df9a9ffdf974935c1f1d0a7906 (diff) | |
download | lufa-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/KeyboardFullInt')
-rw-r--r-- | Demos/KeyboardFullInt/KeyboardFullInt.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/Demos/KeyboardFullInt/KeyboardFullInt.c b/Demos/KeyboardFullInt/KeyboardFullInt.c index 7e90b5ff2..44f983059 100644 --- a/Demos/KeyboardFullInt/KeyboardFullInt.c +++ b/Demos/KeyboardFullInt/KeyboardFullInt.c @@ -404,6 +404,15 @@ ISR(ENDPOINT_PIPE_vect, ISR_BLOCK) USB_KeyboardReport_Data_t KeyboardReportData;
bool SendReport;
+ /* Select the Keyboard Report Endpoint */
+ Endpoint_SelectEndpoint(KEYBOARD_EPNUM);
+
+ /* Clear the endpoint IN interrupt flag */
+ USB_INT_Clear(ENDPOINT_INT_IN);
+
+ /* Clear the Keyboard Report endpoint interrupt */
+ Endpoint_ClearEndpointInterrupt(KEYBOARD_EPNUM);
+
/* Create the next keyboard report for transmission to the host */
SendReport = GetNextReport(&KeyboardReportData);
@@ -420,21 +429,12 @@ ISR(ENDPOINT_PIPE_vect, ISR_BLOCK) /* Check to see if a report should be issued */
if (SendReport)
{
- /* Select the Keyboard Report Endpoint */
- Endpoint_SelectEndpoint(KEYBOARD_EPNUM);
-
- /* Clear the endpoint IN interrupt flag */
- USB_INT_Clear(ENDPOINT_INT_IN);
-
- /* Clear the Keyboard Report endpoint interrupt */
- Endpoint_ClearEndpointInterrupt(KEYBOARD_EPNUM);
-
/* Write Keyboard Report Data */
Endpoint_Write_Stream_LE(&KeyboardReportData, sizeof(KeyboardReportData));
-
- /* Finalize the stream transfer to send the last packet */
- Endpoint_ClearCurrentBank();
}
+
+ /* Finalize the stream transfer to send the last packet */
+ Endpoint_ClearCurrentBank();
}
/* Check if Keyboard LED status Endpoint has interrupted */
|