aboutsummaryrefslogtreecommitdiff
path: root/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'common.h')
-rw-r--r--common.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/common.h b/common.h
index 7b699ca..58a253e 100644
--- a/common.h
+++ b/common.h
@@ -67,6 +67,8 @@ extern volatile uint8_t wakeup;
void shutdownError ();
#define sign(x) ((x < 0) ? -1 : 1)
+/* get an array’s size/length */
+#define length(x) (sizeof(x)/sizeof(*x))
#endif /* COMMON_H */