Minor documentation adjustments to the demos, projects and bootloaders to ensure...
[pub/USBasp.git] / Demos / Device / LowLevel / AudioInput / AudioInput.c
index 0a4d5d4..eb9c4b5 100644 (file)
@@ -7,7 +7,7 @@
 */
 
 /*
 */
 
 /*
-  Copyright 2011  Dean Camera (dean [at] fourwalledcubicle [dot] com)
+  Copyright 2012  Dean Camera (dean [at] fourwalledcubicle [dot] com)
 
   Permission to use, copy, modify, distribute, and sell this
   software and its documentation for any purpose is hereby granted
 
   Permission to use, copy, modify, distribute, and sell this
   software and its documentation for any purpose is hereby granted
@@ -118,8 +118,7 @@ void EVENT_USB_Device_ConfigurationChanged(void)
        bool ConfigSuccess = true;
 
        /* Setup Audio Stream Endpoint */
        bool ConfigSuccess = true;
 
        /* Setup Audio Stream Endpoint */
-       ConfigSuccess &= Endpoint_ConfigureEndpoint(AUDIO_STREAM_EPNUM, EP_TYPE_ISOCHRONOUS, ENDPOINT_DIR_IN,
-                                                   AUDIO_STREAM_EPSIZE, ENDPOINT_BANK_DOUBLE);
+       ConfigSuccess &= Endpoint_ConfigureEndpoint(AUDIO_STREAM_EPADDR, EP_TYPE_ISOCHRONOUS, AUDIO_STREAM_EPSIZE, 2);
 
        /* Indicate endpoint configuration success or failure */
        LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
 
        /* Indicate endpoint configuration success or failure */
        LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
@@ -165,7 +164,7 @@ void EVENT_USB_Device_ControlRequest(void)
                                uint8_t EndpointControl = (USB_ControlRequest.wValue >> 8);
 
                                /* Only handle SET CURRENT requests to the audio endpoint's sample frequency property */
                                uint8_t EndpointControl = (USB_ControlRequest.wValue >> 8);
 
                                /* Only handle SET CURRENT requests to the audio endpoint's sample frequency property */
-                               if ((EndpointAddress == (ENDPOINT_DIR_IN | AUDIO_STREAM_EPNUM)) && (EndpointControl == AUDIO_EPCONTROL_SamplingFreq))
+                               if ((EndpointAddress == AUDIO_STREAM_EPADDR) && (EndpointControl == AUDIO_EPCONTROL_SamplingFreq))
                                {
                                        uint8_t SampleRate[3];
 
                                {
                                        uint8_t SampleRate[3];
 
@@ -190,7 +189,7 @@ void EVENT_USB_Device_ControlRequest(void)
                                uint8_t EndpointControl = (USB_ControlRequest.wValue >> 8);
 
                                /* Only handle GET CURRENT requests to the audio endpoint's sample frequency property */
                                uint8_t EndpointControl = (USB_ControlRequest.wValue >> 8);
 
                                /* Only handle GET CURRENT requests to the audio endpoint's sample frequency property */
-                               if ((EndpointAddress == (ENDPOINT_DIR_IN | AUDIO_STREAM_EPNUM)) && (EndpointControl == AUDIO_EPCONTROL_SamplingFreq))
+                               if ((EndpointAddress == AUDIO_STREAM_EPADDR) && (EndpointControl == AUDIO_EPCONTROL_SamplingFreq))
                                {
                                        uint8_t SampleRate[3];
 
                                {
                                        uint8_t SampleRate[3];
 
@@ -215,7 +214,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
        uint8_t PrevEndpoint = Endpoint_GetCurrentEndpoint();
 
        /* Select the audio stream endpoint */
        uint8_t PrevEndpoint = Endpoint_GetCurrentEndpoint();
 
        /* Select the audio stream endpoint */
-       Endpoint_SelectEndpoint(AUDIO_STREAM_EPNUM);
+       Endpoint_SelectEndpoint(AUDIO_STREAM_EPADDR);
 
        /* Check if the current endpoint can be written to and that the audio interface is enabled */
        if (Endpoint_IsINReady() && StreamingAudioInterfaceSelected)
 
        /* Check if the current endpoint can be written to and that the audio interface is enabled */
        if (Endpoint_IsINReady() && StreamingAudioInterfaceSelected)