diff --git a/targets/arduino/wiring.h b/targets/arduino/wiring.h index c4ba02382..6cbfd132e 100755 --- a/targets/arduino/wiring.h +++ b/targets/arduino/wiring.h @@ -45,10 +45,10 @@ extern "C"{ #define SERIAL 0x0 #define DISPLAY 0x1 -#define min(a,b) ((ab)?(a):(b)) -#define abs(x) ((x>0)?(x):(-x)) -#define constrain(amt,low,high) ((amthigh)?(high):(amt))) +#define min(a,b) ((a)<(b)?(a):(b)) +#define max(a,b) ((a)>(b)?(a):(b)) +#define abs(x) ((x)>0?(x):-(x)) +#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt))) #define radians(deg) ((deg)*DEG_TO_RAD) #define degrees(rad) ((rad)*RAD_TO_DEG) #define sq(x) ((x)*(x))