]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - include/common.h
loadi seems to work now.
[z180-stamp.git] / include / common.h
index cfbbae5c1fc1cf3185f18e67bb9983667d7f9080..10c4417d8b0c147de15a20e142a81fb93265a9d6 100644 (file)
@@ -52,6 +52,12 @@ struct bits {
 #define FSTR(X) ((const FLASH char[]) { X } )
 #define ARRAY_SIZE(x)  (sizeof(x) / sizeof((x)[0]))
 
+#define MIN(a,b)    ({ typeof (a) _a = (a);                                    \
+                                               typeof (b) _b = (b);                                   \
+                                               _a < _b ? _a : _b; })
+#define MAX(a,b)    ({ typeof (a) _a = (a);                                    \
+                                               typeof (b) _b = (b);                                   \
+                                               _a > _b ? _a : _b; })
 
 #ifdef __AVR__
 #define Stat GPIOR0