doc: Added group definitions for most common modules.
[bertos.git] / bertos / cfg / macros.h
index d0ccf433b23321158bc043d1673c6732e4ebac93..0a721ac5a060f703d00a594ed9ab7cad25ae926e 100644 (file)
  *
  * -->
  *
+ * \defgroup macros General purpose macros
+ * \ingroup core
+ * \{
+ *
  * \brief Common and handy function macros
  *
  * \author Bernie Innocenti <bernie@codewiz.org>
        #define MAX(a,b)        (((a) > (b)) ? (a) : (b))
 #endif /* !(COMPILER_STATEMENT_EXPRESSIONS && COMPILER_TYPEOF) */
 
+/** Align \p value to the next \p align boundary */
+#define ALIGN_UP(value, align) (((value) & ((align) - 1)) ? \
+                               (((value) + ((align) - 1)) & ~((align) - 1)) : \
+                               (value))
+
 /** Bound \a x between \a min and \a max. */
 #define MINMAX(min,x,max)  (MIN(MAX(min, x), max))
 
  */
 typedef uint32_t id_t;
 
+/** \} */ //defgroup macros
+
 #endif /* MACROS_H */