projects
/
pub
/
USBasp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d711e37
)
Fixed interrupt driven HID device demos not clearing the interrupt flags in all circu...
author
Dean Camera
<dean@fourwalledcubicle.com>
Mon, 9 Mar 2009 11:50:43 +0000
(11:50 +0000)
committer
Dean Camera
<dean@fourwalledcubicle.com>
Mon, 9 Mar 2009 11:50:43 +0000
(11:50 +0000)
Demos/KeyboardFullInt/KeyboardFullInt.c
patch
|
blob
|
blame
|
history
Demos/KeyboardViaInt/KeyboardViaInt.c
patch
|
blob
|
blame
|
history
Demos/MouseFullInt/MouseFullInt.c
patch
|
blob
|
blame
|
history
Demos/MouseViaInt/MouseViaInt.c
patch
|
blob
|
blame
|
history
diff --git
a/Demos/KeyboardFullInt/KeyboardFullInt.c
b/Demos/KeyboardFullInt/KeyboardFullInt.c
index
7e90b5f
..
44f9830
100644
(file)
--- 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;
\r
bool SendReport;
\r
\r
USB_KeyboardReport_Data_t KeyboardReportData;
\r
bool SendReport;
\r
\r
+ /* Select the Keyboard Report Endpoint */
\r
+ Endpoint_SelectEndpoint(KEYBOARD_EPNUM);
\r
+
\r
+ /* Clear the endpoint IN interrupt flag */
\r
+ USB_INT_Clear(ENDPOINT_INT_IN);
\r
+
\r
+ /* Clear the Keyboard Report endpoint interrupt */
\r
+ Endpoint_ClearEndpointInterrupt(KEYBOARD_EPNUM);
\r
+
\r
/* Create the next keyboard report for transmission to the host */
\r
SendReport = GetNextReport(&KeyboardReportData);
\r
\r
/* Create the next keyboard report for transmission to the host */
\r
SendReport = GetNextReport(&KeyboardReportData);
\r
\r
@@
-420,21
+429,12
@@
ISR(ENDPOINT_PIPE_vect, ISR_BLOCK)
/* Check to see if a report should be issued */
\r
if (SendReport)
\r
{
\r
/* Check to see if a report should be issued */
\r
if (SendReport)
\r
{
\r
- /* Select the Keyboard Report Endpoint */
\r
- Endpoint_SelectEndpoint(KEYBOARD_EPNUM);
\r
-
\r
- /* Clear the endpoint IN interrupt flag */
\r
- USB_INT_Clear(ENDPOINT_INT_IN);
\r
-
\r
- /* Clear the Keyboard Report endpoint interrupt */
\r
- Endpoint_ClearEndpointInterrupt(KEYBOARD_EPNUM);
\r
-
\r
/* Write Keyboard Report Data */
\r
Endpoint_Write_Stream_LE(&KeyboardReportData, sizeof(KeyboardReportData));
\r
/* Write Keyboard Report Data */
\r
Endpoint_Write_Stream_LE(&KeyboardReportData, sizeof(KeyboardReportData));
\r
-
\r
- /* Finalize the stream transfer to send the last packet */
\r
- Endpoint_ClearCurrentBank();
\r
}
\r
}
\r
+
\r
+ /* Finalize the stream transfer to send the last packet */
\r
+ Endpoint_ClearCurrentBank();
\r
}
\r
\r
/* Check if Keyboard LED status Endpoint has interrupted */
\r
}
\r
\r
/* Check if Keyboard LED status Endpoint has interrupted */
\r
diff --git
a/Demos/KeyboardViaInt/KeyboardViaInt.c
b/Demos/KeyboardViaInt/KeyboardViaInt.c
index
7f6fcd8
..
7916506
100644
(file)
--- a/
Demos/KeyboardViaInt/KeyboardViaInt.c
+++ b/
Demos/KeyboardViaInt/KeyboardViaInt.c
@@
-391,7
+391,16
@@
ISR(ENDPOINT_PIPE_vect, ISR_BLOCK)
{
\r
USB_KeyboardReport_Data_t KeyboardReportData;
\r
bool SendReport;
\r
{
\r
USB_KeyboardReport_Data_t KeyboardReportData;
\r
bool SendReport;
\r
-
\r
+
\r
+ /* Select the Keyboard Report Endpoint */
\r
+ Endpoint_SelectEndpoint(KEYBOARD_EPNUM);
\r
+
\r
+ /* Clear the endpoint IN interrupt flag */
\r
+ USB_INT_Clear(ENDPOINT_INT_IN);
\r
+
\r
+ /* Clear the Keyboard Report endpoint interrupt */
\r
+ Endpoint_ClearEndpointInterrupt(KEYBOARD_EPNUM);
\r
+
\r
/* Create the next keyboard report for transmission to the host */
\r
SendReport = GetNextReport(&KeyboardReportData);
\r
\r
/* Create the next keyboard report for transmission to the host */
\r
SendReport = GetNextReport(&KeyboardReportData);
\r
\r
@@
-408,15
+417,6
@@
ISR(ENDPOINT_PIPE_vect, ISR_BLOCK)
/* Check to see if a report should be issued */
\r
if (SendReport)
\r
{
\r
/* Check to see if a report should be issued */
\r
if (SendReport)
\r
{
\r
- /* Select the Keyboard Report Endpoint */
\r
- Endpoint_SelectEndpoint(KEYBOARD_EPNUM);
\r
-
\r
- /* Clear the endpoint IN interrupt flag */
\r
- USB_INT_Clear(ENDPOINT_INT_IN);
\r
-
\r
- /* Clear the Keyboard Report endpoint interrupt */
\r
- Endpoint_ClearEndpointInterrupt(KEYBOARD_EPNUM);
\r
-
\r
/* Write Keyboard Report Data */
\r
Endpoint_Write_Stream_LE(&KeyboardReportData, sizeof(KeyboardReportData));
\r
}
\r
/* Write Keyboard Report Data */
\r
Endpoint_Write_Stream_LE(&KeyboardReportData, sizeof(KeyboardReportData));
\r
}
\r
diff --git
a/Demos/MouseFullInt/MouseFullInt.c
b/Demos/MouseFullInt/MouseFullInt.c
index
c21959a
..
28267a1
100644
(file)
--- 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;
\r
bool SendReport = true;
\r
\r
USB_MouseReport_Data_t MouseReportData;
\r
bool SendReport = true;
\r
\r
+ /* Select the Mouse Report Endpoint */
\r
+ Endpoint_SelectEndpoint(MOUSE_EPNUM);
\r
+
\r
+ /* Clear the endpoint IN interrupt flag */
\r
+ USB_INT_Clear(ENDPOINT_INT_IN);
\r
+
\r
+ /* Clear the Mouse Report endpoint interrupt and select the endpoint */
\r
+ Endpoint_ClearEndpointInterrupt(MOUSE_EPNUM);
\r
+
\r
/* Create the next mouse report for transmission to the host */
\r
GetNextReport(&MouseReportData);
\r
\r
/* Create the next mouse report for transmission to the host */
\r
GetNextReport(&MouseReportData);
\r
\r
@@
-380,20
+389,11
@@
ISR(ENDPOINT_PIPE_vect, ISR_BLOCK)
/* Check to see if a report should be issued */
\r
if (SendReport)
\r
{
\r
/* Check to see if a report should be issued */
\r
if (SendReport)
\r
{
\r
- /* Select the Mouse Report Endpoint */
\r
- Endpoint_SelectEndpoint(MOUSE_EPNUM);
\r
-
\r
- /* Clear the endpoint IN interrupt flag */
\r
- USB_INT_Clear(ENDPOINT_INT_IN);
\r
-
\r
- /* Clear the Mouse Report endpoint interrupt and select the endpoint */
\r
- Endpoint_ClearEndpointInterrupt(MOUSE_EPNUM);
\r
-
\r
/* Write Mouse Report Data */
\r
Endpoint_Write_Stream_LE(&MouseReportData, sizeof(MouseReportData));
\r
/* Write Mouse Report Data */
\r
Endpoint_Write_Stream_LE(&MouseReportData, sizeof(MouseReportData));
\r
-
\r
- /* Finalize the stream transfer to send the last packet */
\r
- Endpoint_ClearCurrentBank();
\r
}
\r
}
\r
+
\r
+ /* Finalize the stream transfer to send the last packet */
\r
+ Endpoint_ClearCurrentBank();
\r
}
\r
}
\r
}
\r
}
\r
diff --git
a/Demos/MouseViaInt/MouseViaInt.c
b/Demos/MouseViaInt/MouseViaInt.c
index
77e4c56
..
a4b863c
100644
(file)
--- a/
Demos/MouseViaInt/MouseViaInt.c
+++ b/
Demos/MouseViaInt/MouseViaInt.c
@@
-345,6
+345,15
@@
ISR(ENDPOINT_PIPE_vect, ISR_BLOCK)
USB_MouseReport_Data_t MouseReportData;
\r
bool SendReport = true;
\r
\r
USB_MouseReport_Data_t MouseReportData;
\r
bool SendReport = true;
\r
\r
+ /* Select the Mouse Report Endpoint */
\r
+ Endpoint_SelectEndpoint(MOUSE_EPNUM);
\r
+
\r
+ /* Clear the endpoint IN interrupt flag */
\r
+ USB_INT_Clear(ENDPOINT_INT_IN);
\r
+
\r
+ /* Clear the Mouse Report endpoint interrupt and select the endpoint */
\r
+ Endpoint_ClearEndpointInterrupt(MOUSE_EPNUM);
\r
+
\r
/* Create the next mouse report for transmission to the host */
\r
GetNextReport(&MouseReportData);
\r
\r
/* Create the next mouse report for transmission to the host */
\r
GetNextReport(&MouseReportData);
\r
\r
@@
-367,15
+376,6
@@
ISR(ENDPOINT_PIPE_vect, ISR_BLOCK)
/* Check to see if a report should be issued */
\r
if (SendReport)
\r
{
\r
/* Check to see if a report should be issued */
\r
if (SendReport)
\r
{
\r
- /* Select the Mouse Report Endpoint */
\r
- Endpoint_SelectEndpoint(MOUSE_EPNUM);
\r
-
\r
- /* Clear the endpoint IN interrupt flag */
\r
- USB_INT_Clear(ENDPOINT_INT_IN);
\r
-
\r
- /* Clear the Mouse Report endpoint interrupt and select the endpoint */
\r
- Endpoint_ClearEndpointInterrupt(MOUSE_EPNUM);
\r
-
\r
/* Write Mouse Report Data */
\r
Endpoint_Write_Stream_LE(&MouseReportData, sizeof(MouseReportData));
\r
}
\r
/* Write Mouse Report Data */
\r
Endpoint_Write_Stream_LE(&MouseReportData, sizeof(MouseReportData));
\r
}
\r