summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschodet2005-11-27 21:28:32 +0000
committerschodet2005-11-27 21:28:32 +0000
commit051bde521bee7be72cd17118f65685dc200e2811 (patch)
tree48836e902e9995ef7288d64024dcb78f4e7fc53c
parente08bd249315838f94ec3253e2dc270395acf644d (diff)
Ajout de UTILS_ABS.
-rw-r--r--n/avr/modules/utils/utils.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/n/avr/modules/utils/utils.h b/n/avr/modules/utils/utils.h
index 535036a..5a58f4b 100644
--- a/n/avr/modules/utils/utils.h
+++ b/n/avr/modules/utils/utils.h
@@ -67,4 +67,7 @@ utils_delay_ms (double ms)
v = max; \
} while (0)
+/** Absolute value. */
+#define UTILS_ABS(v) ((v) > 0 ? (v) : -(v))
+
#endif /* utils_h */