aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Mouse/Mouse.c
diff options
context:
space:
mode:
Diffstat (limited to 'Demos/Mouse/Mouse.c')
-rw-r--r--Demos/Mouse/Mouse.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/Demos/Mouse/Mouse.c b/Demos/Mouse/Mouse.c
index 3e59706c9..da8a4a809 100644
--- a/Demos/Mouse/Mouse.c
+++ b/Demos/Mouse/Mouse.c
@@ -201,6 +201,10 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Send the flag to the host */
Endpoint_ClearSetupIN();
+
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupOUTReceived()));
+ Endpoint_ClearSetupOUT();
}
break;
@@ -215,7 +219,8 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Set or clear the flag depending on what the host indicates that the current Protocol should be */
UsingReportProtocol = (wValue != 0x0000);
- /* Send an empty packet to acknowedge the command */
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupINReady()));
Endpoint_ClearSetupIN();
}
@@ -231,7 +236,8 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Get idle period in MSB */
IdleCount = (wValue >> 8);
- /* Send an empty packet to acknowedge the command */
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupINReady()));
Endpoint_ClearSetupIN();
}
@@ -246,6 +252,10 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Send the flag to the host */
Endpoint_ClearSetupIN();
+
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupOUTReceived()));
+ Endpoint_ClearSetupOUT();
}
break;