aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Device
diff options
context:
space:
mode:
Diffstat (limited to 'Demos/Device')
-rw-r--r--Demos/Device/GenericHID/GenericHID.c14
-rw-r--r--Demos/Device/Mouse/Mouse.c2
2 files changed, 15 insertions, 1 deletions
diff --git a/Demos/Device/GenericHID/GenericHID.c b/Demos/Device/GenericHID/GenericHID.c
index 2d9869982..3b5f97267 100644
--- a/Demos/Device/GenericHID/GenericHID.c
+++ b/Demos/Device/GenericHID/GenericHID.c
@@ -103,6 +103,11 @@ EVENT_HANDLER(USB_Reset)
*/
EVENT_HANDLER(USB_Connect)
{
+ #if !defined(INTERRUPT_CONTROL_ENDPOINT)
+ /* Start USB management task */
+ Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);
+ #endif
+
/* Indicate USB enumerating */
UpdateStatus(Status_USBEnumerating);
}
@@ -112,6 +117,15 @@ EVENT_HANDLER(USB_Connect)
*/
EVENT_HANDLER(USB_Disconnect)
{
+ /* Stop running HID reporting and USB management tasks */
+ #if !defined(INTERRUPT_DATA_ENDPOINT)
+ Scheduler_SetTaskMode(USB_HID_Report, TASK_STOP);
+ #endif
+
+ #if !defined(INTERRUPT_CONTROL_ENDPOINT)
+ Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
+ #endif
+
/* Indicate USB not ready */
UpdateStatus(Status_USBNotReady);
}
diff --git a/Demos/Device/Mouse/Mouse.c b/Demos/Device/Mouse/Mouse.c
index c429768c9..076ac5bbd 100644
--- a/Demos/Device/Mouse/Mouse.c
+++ b/Demos/Device/Mouse/Mouse.c
@@ -145,7 +145,7 @@ EVENT_HANDLER(USB_Reset)
*/
EVENT_HANDLER(USB_Disconnect)
{
- /* Stop running keyboard reporting and USB management tasks */
+ /* Stop running mouse reporting and USB management tasks */
#if !defined(INTERRUPT_DATA_ENDPOINT)
Scheduler_SetTaskMode(USB_Mouse_Report, TASK_STOP);
#endif