Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Erik Strand
lufa
Commits
b0d9f961
Commit
b0d9f961
authored
Mar 09, 2009
by
Dean Camera
Browse files
Fixed interrupt driven HID device demos not clearing the interrupt flags in all circumstances.
parent
d711e37d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Demos/KeyboardFullInt/KeyboardFullInt.c
View file @
b0d9f961
...
...
@@ -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 */
...
...
Demos/KeyboardViaInt/KeyboardViaInt.c
View file @
b0d9f961
...
...
@@ -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
));
}
...
...
Demos/MouseFullInt/MouseFullInt.c
View file @
b0d9f961
...
...
@@ -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
();
}
}
Demos/MouseViaInt/MouseViaInt.c
View file @
b0d9f961
...
...
@@ -345,6 +345,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
);
...
...
@@ -367,15 +376,6 @@ 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
));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment