aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Common/Common.h
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2011-01-26 21:33:07 +0000
committerDean Camera <dean@fourwalledcubicle.com>2011-01-26 21:33:07 +0000
commita852ea8e43d6df9642df3524a974073d2229fa4c (patch)
tree7524d3d7c881de32080cb0ed82fc4aa16d6f7755 /LUFA/Common/Common.h
parent6c7ed7ecd6d4727e33ddb8c5e4321499a2b76151 (diff)
downloadlufa-a852ea8e43d6df9642df3524a974073d2229fa4c.tar.gz
lufa-a852ea8e43d6df9642df3524a974073d2229fa4c.tar.bz2
lufa-a852ea8e43d6df9642df3524a974073d2229fa4c.zip
Added new KeyboardMouseMultiReport Device ClassDriver demo.
Fixed ReportID not being removed from the feature/out report data array in the HID class driver when Report IDs are used. Added new MAX() and MIN() convenience macros.
Diffstat (limited to 'LUFA/Common/Common.h')
-rw-r--r--LUFA/Common/Common.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/LUFA/Common/Common.h b/LUFA/Common/Common.h
index 837cb0475..c1aa27a5f 100644
--- a/LUFA/Common/Common.h
+++ b/LUFA/Common/Common.h
@@ -79,6 +79,30 @@
*/
#define MACROE while (0)
+ /** Convenience macro to determine the larger of two values.
+ *
+ * \note This macro should only be used with operands that do not have side effects from being evaluated
+ * multiple times.
+ *
+ * \param[in] x First value to compare
+ * \param[in] y First value to compare
+ *
+ * \return The larger of the two input parameters
+ */
+ #define MAX(x, y) ((x > y) ? x : y)
+
+ /** Convenience macro to determine the smaller of two values.
+ *
+ * \note This macro should only be used with operands that do not have side effects from being evaluated
+ * multiple times.
+ *
+ * \param[in] x First value to compare
+ * \param[in] y First value to compare
+ *
+ * \return The smaller of the two input parameters
+ */
+ #define MIN(x, y) ((x < y) ? x : y)
+
/** Defines a volatile \c NOP statement which cannot be optimized out by the compiler, and thus can always
* be set as a breakpoint in the resulting code. Useful for debugging purposes, where the optimiser
* removes/reorders code to the point where break points cannot reliably be set.