Minor documentation fixes.
authorDean Camera <dean@fourwalledcubicle.com>
Tue, 23 Aug 2011 10:39:04 +0000 (10:39 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Tue, 23 Aug 2011 10:39:04 +0000 (10:39 +0000)
Add extra parenthesis around terms in the common MIN() and MAX() macros to prevent issues with non-trivial macro inputs (thanks to David Lyons).

LUFA/Common/Common.h
LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.c
LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.c
LUFA/Drivers/USB/Core/UC3/EndpointStream_UC3.c
LUFA/Drivers/USB/Core/UC3/PipeStream_UC3.c
LUFA/Drivers/USB/Core/XMEGA/EndpointStream_XMEGA.c
LUFA/ManPages/MigrationInformation.txt

index e38d63e..43df9fb 100644 (file)
                         *  \return The larger of the two input parameters
                         */
                        #if !defined(MAX) || defined(__DOXYGEN__)
-                               #define MAX(x, y)               ((x > y) ? x : y)
+                               #define MAX(x, y)               (((x) > (y)) ? (x) : (y))
                        #endif
 
                        /** Convenience macro to determine the smaller of two values.
                         *  \return The smaller of the two input parameters
                         */
                        #if !defined(MIN) || defined(__DOXYGEN__)
-                               #define MIN(x, y)               ((x < y) ? x : y)
+                               #define MIN(x, y)               (((x) < (y)) ? (x) : (y))
                        #endif
                        
                        #if !defined(STRINGIFY) || defined(__DOXYGEN__)
index 6682dc0..0990759 100644 (file)
@@ -114,6 +114,9 @@ uint8_t Endpoint_Null_Stream(uint16_t Length,
        return ENDPOINT_RWSTREAM_NoError;\r
 }\r
 \r
+/* The following abuses the C preprocessor in order to copy-paste common code with slight alterations,\r
+ * so that the code needs to be written once. It is a crude form of templating to reduce code maintenance. */\r
+\r
 #define  TEMPLATE_FUNC_NAME                        Endpoint_Write_Stream_LE\r
 #define  TEMPLATE_BUFFER_TYPE                      const void*\r
 #define  TEMPLATE_CLEAR_ENDPOINT()                 Endpoint_ClearIN()\r
index b3d263c..7b76283 100644 (file)
@@ -119,7 +119,7 @@ uint8_t Pipe_Null_Stream(uint16_t Length,
        return PIPE_RWSTREAM_NoError;\r
 }\r
 \r
-/* The following abuses the C preprocessor in order to copy-past common code with slight alterations,\r
+/* The following abuses the C preprocessor in order to copy-paste common code with slight alterations,\r
  * so that the code needs to be written once. It is a crude form of templating to reduce code maintenance. */\r
 \r
 #define  TEMPLATE_FUNC_NAME                        Pipe_Write_Stream_LE\r
index 98d3ac0..1437087 100644 (file)
@@ -114,6 +114,9 @@ uint8_t Endpoint_Null_Stream(uint16_t Length,
        return ENDPOINT_RWSTREAM_NoError;\r
 }\r
 \r
+/* The following abuses the C preprocessor in order to copy-paste common code with slight alterations,\r
+ * so that the code needs to be written once. It is a crude form of templating to reduce code maintenance. */\r
+\r
 #define  TEMPLATE_FUNC_NAME                        Endpoint_Write_Stream_LE\r
 #define  TEMPLATE_BUFFER_TYPE                      const void*\r
 #define  TEMPLATE_CLEAR_ENDPOINT()                 Endpoint_ClearIN()\r
index 3aa815c..3b8267a 100644 (file)
@@ -119,7 +119,7 @@ uint8_t Pipe_Null_Stream(uint16_t Length,
        return PIPE_RWSTREAM_NoError;\r
 }\r
 \r
-/* The following abuses the C preprocessor in order to copy-past common code with slight alterations,\r
+/* The following abuses the C preprocessor in order to copy-paste common code with slight alterations,\r
  * so that the code needs to be written once. It is a crude form of templating to reduce code maintenance. */\r
 \r
 #define  TEMPLATE_FUNC_NAME                        Pipe_Write_Stream_LE\r
index b1b05bf..15ee479 100644 (file)
@@ -114,6 +114,9 @@ uint8_t Endpoint_Null_Stream(uint16_t Length,
        return ENDPOINT_RWSTREAM_NoError;\r
 }\r
 \r
+/* The following abuses the C preprocessor in order to copy-paste common code with slight alterations,\r
+ * so that the code needs to be written once. It is a crude form of templating to reduce code maintenance. */\r
+\r
 #define  TEMPLATE_FUNC_NAME                        Endpoint_Write_Stream_LE\r
 #define  TEMPLATE_BUFFER_TYPE                      const void*\r
 #define  TEMPLATE_CLEAR_ENDPOINT()                 Endpoint_ClearIN()\r
index 078887a..c465a4a 100644 (file)
@@ -19,7 +19,7 @@
  *      reconfiguring all Endpoints/Pipes in order each time a new Endpoint/Pipe is created. To minimize the compiled program
  *      size, the new \c ORDERED_EP_CONFIG compile time option may be defined in the project makefile to restrict the ordering
  *      in exchange for a smaller compiled binary size.
- *    - The previous F_CLOCK symbol, required in the project makefile, has been renamed to F_USB. This is due to the previous name
+ *    - The previous \c F_CLOCK symbol, required in the project makefile, has been renamed to \c F_USB. This is due to the previous name
  *      being far too generic for use in future architecture ports, where multiple clock domains are used.
  *
  *  <b>Device Mode</b>
  *      error code to allow the user application to determine when to send the next chunk of data.
  *    - The \ref CDC_Device_SendString() function now expects a null terminated string instead of an explicit length. Existing code
  *      should use the new \ref CDC_Device_SendData() function, or remove the length parameter from the function call.
- *    - The Endpoint_ResetFIFO() function has been renamed to \ref Endpoint_ResetEndpoint(), to make the API function names more
+ *    - The \c Endpoint_ResetFIFO() function has been renamed to \ref Endpoint_ResetEndpoint(), to make the API function names more
  *      consistent. Existing applications using the old function name should simply replace it with a call to the new function name.
- *    - The Endpoint_*_Byte() functions have been renamed Endpoint_*_8() to ensure they are correct across all architectures. Existing
+ *    - The \c Endpoint_*_Byte() functions have been renamed Endpoint_*_8() to ensure they are correct across all architectures. Existing
  *      code using these functions should replace the previous function names with the new function names.
- *    - The Endpoint_*_Word() functions have been renamed Endpoint_*_16() to ensure they are correct across all architectures. Existing
+ *    - The \c Endpoint_*_Word() functions have been renamed Endpoint_*_16() to ensure they are correct across all architectures. Existing
  *      code using these functions should replace the previous function names with the new function names.
- *    - The Endpoint_*_DWord() functions have been renamed Endpoint_*_32() to ensure they are correct across all architectures. Existing
+ *    - The \c Endpoint_*_DWord() functions have been renamed Endpoint_*_32() to ensure they are correct across all architectures. Existing
  *      code using these functions should replace the previous function names with the new function names.
  *    - The Device mode RNDIS class driver no longer stores the incoming and outgoing packets in the class driver instance; the user is
  *      now expected to manually define a storage location for the packet data. Packets must now be sent and received manually via a call
  *    - The \ref PRNT_Host_SendString() and \ref CDC_Host_SendString() functions now expect a null terminated string instead of an explicit
  *      length. Existing code should use the new \ref PRNT_Host_SendData() and \ref CDC_Host_SendData() functions, or remove the
  *      length parameter from the function call.
- *    - The Pipe_ClearErrorFlags() function has been removed, as the pipe error flags are now automatically cleared when the
+ *    - The \c Pipe_ClearErrorFlags() function has been removed, as the pipe error flags are now automatically cleared when the
  *      \ref Pipe_ClearError() function is called.
- *    - The Pipe_*_Byte() functions have been renamed Pipe_*_8() to ensure they are correct across all architectures. Existing code using
+ *    - The \c Pipe_*_Byte() functions have been renamed Pipe_*_8() to ensure they are correct across all architectures. Existing code using
  *      these functions should replace the previous function names with the new function names.
- *    - The Pipe_*_Word() functions have been renamed Pipe_*_16() to ensure they are correct across all architectures. Existing code using
+ *    - The \c Pipe_*_Word() functions have been renamed Pipe_*_16() to ensure they are correct across all architectures. Existing code using
  *      these functions should replace the previous function names with the new function names.
- *    - The Pipe_*_DWord() functions have been renamed Pipe_*_32() to ensure they are correct across all architectures. Existing code using
+ *    - The \c Pipe_*_DWord() functions have been renamed Pipe_*_32() to ensure they are correct across all architectures. Existing code using
  *      these functions should replace the previous function names with the new function names.
+ *    - The \c USB_Host_ClearPipeStall() function has been renamed to USB_Host_ClearEndpointStall(), as it operates on a full endpoing address
+ *      within the attached device and not a pipe within the host. Existing code using the old function name should update the function calls and
+ *      check for correct usage.
  *
  *  \section Sec_Migration101122 Migrating from 100807 to 101122
  *  <b>USB Core</b>