]> mj.ucw.cz Git - home-hw.git/blobdiff - lib/util.h
Bootloader: Checksum after flashing
[home-hw.git] / lib / util.h
index f7fe61dd935e1b4ed59453dcd04d738ac5202dfa..6b9f4ba488dd94a54daab69a866ba7ce10253d2c 100644 (file)
@@ -24,6 +24,7 @@ typedef int32_t s32;
 #define MIN(x,y) ((x) < (y) ? (x) : (y))
 #define MAX(x,y) ((x) > (y) ? (x) : (y))
 #define CLAMP(x,min,max) ({ typeof(x) _t=x; (_t < min) ? min : (_t > max) ? max : _t; })
+#define ARRAY_SIZE(ary) (sizeof(ary)/sizeof((ary)[0]))
 
 #define UNUSED __attribute__((unused))