Enable strict prototype matching in the library Doxygen configuration file, to ensure...
[pub/USBasp.git] / Demos / Host / LowLevel / AudioOutputHost / AudioOutputHost.c
index a1f255f..2b89807 100644 (file)
@@ -74,6 +74,9 @@ void SetupHardware(void)
 
        /* Create a stdio stream for the serial port for stdin and stdout */
        Serial_CreateStream(NULL);
+
+       /* Start the ADC conversion in free running mode */
+       ADC_StartReading(ADC_REFERENCE_AVCC | ADC_RIGHT_ADJUSTED | ADC_GET_CHANNEL_MASK(MIC_IN_ADC_CHANNEL));   
 }
 
 /** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and
@@ -155,6 +158,9 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
        /* Set the sample rate on the streaming interface endpoint */
        if ((ErrorCode = USB_Host_SendControlRequest(&SampleRate)) != HOST_SENDCONTROL_Successful)
        {
+               printf_P(PSTR(ESC_FG_RED "Could not set requested Audio sample rate.\r\n"
+                                        " -- Error Code: %d\r\n" ESC_FG_WHITE), ErrorCode);
+
                LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
                USB_Host_SetDeviceConfiguration(0);
                return;