-\r
- /* Scheduling - routine never returns, so put this last in the main function */\r
- Scheduler_Start();\r
-}\r
-\r
-/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs. */\r
-void EVENT_USB_Connect(void)\r
-{\r
- /* Start USB management task */\r
- Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);\r
-\r
- /* Indicate USB enumerating */\r
- UpdateStatus(Status_USBEnumerating);\r
-}\r
-\r
-/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via\r
- * the status LEDs, disables the sample update and PWM output timers and stops the USB and MIDI management tasks.\r
- */\r
-void EVENT_USB_Disconnect(void)\r
-{\r
- /* Stop running audio and USB management tasks */\r
- Scheduler_SetTaskMode(USB_MIDI_Task, TASK_STOP);\r
- Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);\r
-\r
- /* Indicate USB not ready */\r
- UpdateStatus(Status_USBNotReady);\r
-}\r
-\r
-/** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration\r
- * of the USB device after enumeration - the device endpoints are configured and the MIDI management task started.\r
- */\r
-void EVENT_USB_ConfigurationChanged(void)\r
-{\r
- /* Setup MIDI stream endpoints */\r
- Endpoint_ConfigureEndpoint(MIDI_STREAM_OUT_EPNUM, EP_TYPE_BULK,\r
- ENDPOINT_DIR_OUT, MIDI_STREAM_EPSIZE,\r
- ENDPOINT_BANK_SINGLE);\r
-\r
- Endpoint_ConfigureEndpoint(MIDI_STREAM_IN_EPNUM, EP_TYPE_BULK,\r
- ENDPOINT_DIR_IN, MIDI_STREAM_EPSIZE,\r
- ENDPOINT_BANK_SINGLE);\r
-\r
- /* Indicate USB connected and ready */\r
- UpdateStatus(Status_USBReady);\r
-\r
- /* Start MIDI task */\r
- Scheduler_SetTaskMode(USB_MIDI_Task, TASK_RUN);\r