Fixed GenericHID demo not starting USB and HID management tasks when not using interrupt driven modes (thanks to Carl Kjeldsen).

This commit is contained in:
Dean Camera 2009-04-09 00:00:59 +00:00
parent 51910b4505
commit d3484e6bdd
3 changed files with 16 additions and 1 deletions

View file

@ -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);
}