- /* Setup audio stream endpoint */\r
- Endpoint_ConfigureEndpoint(AUDIO_STREAM_EPNUM, EP_TYPE_ISOCHRONOUS,\r
- ENDPOINT_DIR_IN, AUDIO_STREAM_EPSIZE,\r
- ENDPOINT_BANK_DOUBLE);\r
-\r
- /* Indicate USB connected and ready */\r
- UpdateStatus(Status_USBReady);\r
-}\r
-\r
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific\r
- * control requests that are not handled internally by the USB library (including the Audio class-specific\r
- * requests) so that they can be handled appropriately for the application.\r
- */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
-{\r
- /* Process General and Audio specific control requests */\r
- switch (USB_ControlRequest.bRequest)\r
- {\r
- case REQ_SetInterface:\r
- /* Set Interface is not handled by the library, as its function is application-specific */\r
- if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_INTERFACE))\r
- {\r
- Endpoint_ClearSETUP();\r
- \r
- /* Check if the host is enabling the audio interface (setting AlternateSetting to 1) */\r
- if (USB_ControlRequest.wValue)\r
- {\r
- /* Start audio task */\r
- Scheduler_SetTaskMode(USB_Audio_Task, TASK_RUN);\r
- }\r
- else\r
- {\r
- /* Stop audio task */\r
- Scheduler_SetTaskMode(USB_Audio_Task, TASK_STOP); \r
- }\r
- \r
- /* Acknowledge status stage */\r
- while (!(Endpoint_IsINReady()));\r
- Endpoint_ClearIN();\r
- }\r
-\r
- break;\r
- }\r
-}\r
-\r
-/** Function to manage status updates to the user. This is done via LEDs on the given board, if available, but may be changed to\r
- * log to a serial port, or anything else that is suitable for status updates.\r
- *\r
- * \param CurrentStatus Current status of the system, from the AudioInput_StatusCodes_t enum\r
- */\r
-void UpdateStatus(uint8_t CurrentStatus)\r
-{\r
- uint8_t LEDMask = LEDS_NO_LEDS;\r