The Audio_Device_IsSampleReceived() and Audio_Device_IsReadyForNextSample() functions...
authorDean Camera <dean@fourwalledcubicle.com>
Thu, 29 Apr 2010 14:54:11 +0000 (14:54 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Thu, 29 Apr 2010 14:54:11 +0000 (14:54 +0000)
Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c
Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothHCICommands.c
LUFA/Drivers/USB/Class/Device/Audio.c
LUFA/Drivers/USB/Class/Device/Audio.h
LUFA/ManPages/ChangeLog.txt

index 8b012b4..beec0a7 100644 (file)
@@ -197,7 +197,7 @@ int main(void)
                                        break;\r
                                }\r
                        \r
-                               puts_P(PSTR("\r\nContents of first block:"));\r
+                               puts_P(PSTR("\r\nContents of first block:\r\n"));\r
 \r
                                for (uint16_t Chunk = 0; Chunk < (DiskCapacity.BlockSize >> 4); Chunk++)\r
                                {\r
index d83b93b..740ce67 100644 (file)
   this software.\r
 */\r
 \r
+/*\r
+       TODO: Add local to remote device connections\r
+ */\r
+\r
 #define  INCLUDE_FROM_BLUETOOTHHCICOMMANDS_C\r
 #include "BluetoothHCICommands.h"\r
 \r
index d2572e9..a10e6a5 100644 (file)
@@ -86,22 +86,4 @@ bool Audio_Device_ConfigureEndpoints(USB_ClassInfo_Audio_Device_t* AudioInterfac
        return true;\r
 }\r
 \r
-bool Audio_Device_IsSampleReceived(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)\r
-{\r
-       if ((USB_DeviceState != DEVICE_STATE_Configured) || !(AudioInterfaceInfo->State.InterfaceEnabled))\r
-         return false;\r
-       \r
-       Endpoint_SelectEndpoint(AudioInterfaceInfo->Config.DataOUTEndpointNumber);      \r
-       return Endpoint_IsOUTReceived();\r
-}\r
-\r
-bool Audio_Device_IsReadyForNextSample(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)\r
-{\r
-       if ((USB_DeviceState != DEVICE_STATE_Configured) || !(AudioInterfaceInfo->State.InterfaceEnabled))\r
-         return false;\r
-       \r
-       Endpoint_SelectEndpoint(AudioInterfaceInfo->Config.DataINEndpointNumber);\r
-       return Endpoint_IsINReady();\r
-}\r
-\r
 #endif
\ No newline at end of file
index 2d33f39..fd821e9 100644 (file)
                         */\r
                        void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);\r
                        \r
+               /* Inline Functions: */         \r
+                       /** General management task for a given Audio class interface, required for the correct operation of the interface. This should\r
+                        *  be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().\r
+                        *\r
+                        *  \param[in,out] AudioInterfaceInfo  Pointer to a structure containing an Audio Class configuration and state\r
+                        */\r
+                       static inline void Audio_Device_USBTask(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo);\r
+                       static inline void Audio_Device_USBTask(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)\r
+                       {\r
+                               (void)AudioInterfaceInfo;\r
+                       }\r
+\r
                        /** Determines if the given audio interface is ready for a sample to be read from it, and selects the streaming\r
                         *  OUT endpoint ready for reading.\r
                         *\r
                         *  \param[in,out] AudioInterfaceInfo  Pointer to a structure containing an Audio Class configuration and state\r
                         *\r
                         *  \return Boolean true if the given Audio interface has a sample to be read, false otherwise\r
-                        */\r
-                       bool Audio_Device_IsSampleReceived(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo);\r
+                        */             \r
+                       static inline bool Audio_Device_IsSampleReceived(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)\r
+                       {\r
+                               if ((USB_DeviceState != DEVICE_STATE_Configured) || !(AudioInterfaceInfo->State.InterfaceEnabled))\r
+                                 return false;\r
+                               \r
+                               Endpoint_SelectEndpoint(AudioInterfaceInfo->Config.DataOUTEndpointNumber);      \r
+                               return Endpoint_IsOUTReceived();\r
+                       }\r
 \r
                        /** Determines if the given audio interface is ready to accept the next sample to be written to it, and selects\r
                         *  the streaming IN endpoint ready for writing.\r
                         *\r
                         *  \return Boolean true if the given Audio interface is ready to accept the next sample, false otherwise\r
                         */\r
-                       bool Audio_Device_IsReadyForNextSample(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo);\r
-\r
-               /* Inline Functions: */\r
-                       /** General management task for a given Audio class interface, required for the correct operation of the interface. This should\r
-                        *  be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().\r
-                        *\r
-                        *  \param[in,out] AudioInterfaceInfo  Pointer to a structure containing an Audio Class configuration and state\r
-                        */\r
-                       static inline void Audio_Device_USBTask(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo);\r
-                       static inline void Audio_Device_USBTask(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)\r
+                       static inline bool Audio_Device_IsReadyForNextSample(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)\r
                        {\r
-                               (void)AudioInterfaceInfo;\r
+                               if ((USB_DeviceState != DEVICE_STATE_Configured) || !(AudioInterfaceInfo->State.InterfaceEnabled))\r
+                                 return false;\r
+                               \r
+                               Endpoint_SelectEndpoint(AudioInterfaceInfo->Config.DataINEndpointNumber);\r
+                               return Endpoint_IsINReady();\r
                        }\r
 \r
                        /** Reads the next 8-bit audio sample from the current audio interface.\r
index 04aa9a4..6eec642 100644 (file)
@@ -30,6 +30,7 @@
   *  - Removed two-step endpoint/pipe bank clear and switch sequence for smaller, faster endpoint/pipe code\r
   *  - The USB_Init() function no longer calls sei() - the user is now responsible for enabling interrupts when they are ready\r
   *    for them to be enabled (thanks to Andrei Krainev)\r
+  *  - The Audio_Device_IsSampleReceived() and Audio_Device_IsReadyForNextSample() functions are now inline, to reduce overhead\r
   *\r
   *  <b>Fixed:</b>\r
   *  - Fixed software PDI/TPI programming mode in the AVRISP project not correctly toggling just the clock pin\r