aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/KeyboardViaInt/KeyboardViaInt.c
diff options
context:
space:
mode:
Diffstat (limited to 'Demos/KeyboardViaInt/KeyboardViaInt.c')
-rw-r--r--Demos/KeyboardViaInt/KeyboardViaInt.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/Demos/KeyboardViaInt/KeyboardViaInt.c b/Demos/KeyboardViaInt/KeyboardViaInt.c
index 7f6fcd8cd..791650675 100644
--- a/Demos/KeyboardViaInt/KeyboardViaInt.c
+++ b/Demos/KeyboardViaInt/KeyboardViaInt.c
@@ -391,7 +391,16 @@ 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);
@@ -408,15 +417,6 @@ 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));
}