Add macro guards to the templated C files to prevent compile errors if they are mista...
[pub/USBasp.git] / LUFA / Drivers / USB / Class / Host / Audio.h
index befcc2f..81dcedb 100644 (file)
                        {\r
                                const struct\r
                                {\r
-                                       uint8_t  DataINPipeNumber; /**< Pipe number of the Audio interface's IN data pipe. */\r
-                                       uint8_t  DataOUTPipeNumber; /**< Pipe number of the Audio interface's OUT data pipe. */\r
+                                       uint8_t  DataINPipeNumber; /**< Pipe number of the Audio interface's IN data pipe. If this interface should not\r
+                                                                   *   bind to an IN endpoint, this may be set to 0 to disable audio input streaming for\r
+                                                                   *   this driver instance.\r
+                                                                   */\r
+                                       uint8_t  DataOUTPipeNumber; /**< Pipe number of the Audio interface's OUT data pipe. If this interface should not\r
+                                                                   *   bind to an OUT endpoint, this may be set to 0 to disable audio output streaming for\r
+                                                                   *   this driver instance.\r
+                                                                   */\r
                                } Config; /**< Config data for the USB class interface within the device. All elements in this section\r
                                           *   <b>must</b> be set or the interface will fail to enumerate and operate correctly.\r
                                           */\r
                         *  \return A value from the \ref USB_Host_SendControlErrorCodes_t enum.\r
                         */\r
                        uint8_t Audio_Host_StartStopStreaming(USB_ClassInfo_Audio_Host_t* const AudioInterfaceInfo,\r
-                                                             bool EnableStreaming);\r
+                                                             const bool EnableStreaming);\r
 \r
                        /** Gets or sets the specified property of a streaming audio class endpoint that is bound to a pipe in the given\r
                         *  class instance.\r
                                                             const uint8_t DataPipeIndex,\r
                                                             const uint8_t EndpointProperty,\r
                                                             const uint8_t EndpointControl,\r
-                                                            uint16_t const DataLength,\r
+                                                            const uint16_t DataLength,\r
                                                             void* const Data);\r
 \r
                /* Inline Functions: */\r
                        {\r
                                Pipe_Write_8(Sample);\r
 \r
-                               if (Pipe_BytesInPipe() == AudioInterfaceInfo->State.DataOUTPipeSize)\r
+                               if (!(Pipe_IsReadWriteAllowed()))\r
                                {\r
                                        Pipe_Unfreeze();\r
                                        Pipe_ClearOUT();\r
+                                       Pipe_WaitUntilReady();\r
                                        Pipe_Freeze();\r
                                }\r
                        }\r
                        {\r
                                Pipe_Write_16_LE(Sample);\r
 \r
-                               if (Pipe_BytesInPipe() == AudioInterfaceInfo->State.DataOUTPipeSize)\r
+                               if (!(Pipe_IsReadWriteAllowed()))\r
                                {\r
                                        Pipe_Unfreeze();\r
                                        Pipe_ClearOUT();\r
+                                       Pipe_WaitUntilReady();\r
                                        Pipe_Freeze();\r
                                }\r
                        }\r
                                Pipe_Write_16_LE(Sample);\r
                                Pipe_Write_8(Sample >> 16);\r
 \r
-                               if (Pipe_BytesInPipe() == AudioInterfaceInfo->State.DataOUTPipeSize)\r
+                               if (!(Pipe_IsReadWriteAllowed()))\r
                                {\r
                                        Pipe_Unfreeze();\r
                                        Pipe_ClearOUT();\r
+                                       Pipe_WaitUntilReady();\r
                                        Pipe_Freeze();\r
                                }\r
                        }\r
        #if !defined(__DOXYGEN__)\r
                /* Function Prototypes: */\r
                        #if defined(__INCLUDE_FROM_AUDIO_HOST_C)\r
-                               static uint8_t DComp_NextAudioControlInterface(void* CurrentDescriptor);\r
-                               static uint8_t DComp_NextAudioStreamInterface(void* CurrentDescriptor);\r
-                               static uint8_t DComp_NextAudioInterfaceDataEndpoint(void* CurrentDescriptor);\r
+                               static uint8_t DCOMP_Audio_Host_NextAudioControlInterface(void* CurrentDescriptor);\r
+                               static uint8_t DCOMP_Audio_Host_NextAudioStreamInterface(void* CurrentDescriptor);\r
+                               static uint8_t DCOMP_Audio_Host_NextAudioInterfaceDataEndpoint(void* CurrentDescriptor);\r
                        #endif\r
        #endif\r
 \r