Fixed interrupt driven HID device demos not clearing the interrupt flags in all circumstances.
This commit is contained in:
parent
d711e37d2f
commit
b0d9f961ac
4 changed files with 43 additions and 43 deletions
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue