summary | 
shortlog | 
log | 
commit | commitdiff | 
tree
raw | 
patch | 
inline | side by side (from parent 1: 
2d9f98b)
 
Add extra parenthesis around terms in the common MIN() and MAX() macros to prevent issues with non-trivial macro inputs (thanks to David Lyons).
                         *  \return The larger of the two input parameters
                         */
                        #if !defined(MAX) || defined(__DOXYGEN__)
                         *  \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.
                        #endif
 
                        /** Convenience macro to determine the smaller of two values.
                         *  \return The smaller of the two input parameters
                         */
                        #if !defined(MIN) || defined(__DOXYGEN__)
                         *  \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__)
                        #endif
                        
                        #if !defined(STRINGIFY) || defined(__DOXYGEN__)
 
        return ENDPOINT_RWSTREAM_NoError;\r
 }\r
 \r
        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
 #define  TEMPLATE_FUNC_NAME                        Endpoint_Write_Stream_LE\r
 #define  TEMPLATE_BUFFER_TYPE                      const void*\r
 #define  TEMPLATE_CLEAR_ENDPOINT()                 Endpoint_ClearIN()\r
 
        return PIPE_RWSTREAM_NoError;\r
 }\r
 \r
        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
  * 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
 
        return ENDPOINT_RWSTREAM_NoError;\r
 }\r
 \r
        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
 #define  TEMPLATE_FUNC_NAME                        Endpoint_Write_Stream_LE\r
 #define  TEMPLATE_BUFFER_TYPE                      const void*\r
 #define  TEMPLATE_CLEAR_ENDPOINT()                 Endpoint_ClearIN()\r
 
        return PIPE_RWSTREAM_NoError;\r
 }\r
 \r
        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
  * 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
 
        return ENDPOINT_RWSTREAM_NoError;\r
 }\r
 \r
        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
 #define  TEMPLATE_FUNC_NAME                        Endpoint_Write_Stream_LE\r
 #define  TEMPLATE_BUFFER_TYPE                      const void*\r
 #define  TEMPLATE_CLEAR_ENDPOINT()                 Endpoint_ClearIN()\r
 
  *      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.
  *      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>
  *      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.
  *      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.
  *      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.
  *      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.
  *      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
  *      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 \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.
  *      \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.
  *      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.
  *      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.
  *      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>
  *
  *  \section Sec_Migration101122 Migrating from 100807 to 101122
  *  <b>USB Core</b>