X-Git-Url: http://cloudbase.mooo.com/gitweb/z180-stamp.git/blobdiff_plain/35edb766593d019b89a3f40b6d6cdd2b50f18032..1157e75889d3d6d23d1e2514f401cd5b354bd149:/include/common.h diff --git a/include/common.h b/include/common.h index cfbbae5..10c4417 100644 --- a/include/common.h +++ b/include/common.h @@ -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