summaryrefslogtreecommitdiffstats
path: root/firmware/export/system.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export/system.h')
-rw-r--r--firmware/export/system.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/firmware/export/system.h b/firmware/export/system.h
index c7f5a8112c..f26b3d7f56 100644
--- a/firmware/export/system.h
+++ b/firmware/export/system.h
@@ -97,6 +97,11 @@ int get_cpu_boost_counter(void);
#define MAX(a, b) (((a)>(b))?(a):(b))
#endif
+#ifndef SGN
+#define SGN(a) \
+ ({ typeof (a) ___a = (a); (___a > 0) - (___a < 0); })
+#endif
+
/* return number of elements in array a */
#define ARRAYLEN(a) (sizeof(a)/sizeof((a)[0]))