From caa2b25b407985686c419be1fd7fb75ff0eb9ee0 Mon Sep 17 00:00:00 2001 From: Daid Date: Sun, 11 Nov 2012 11:17:54 +0100 Subject: [PATCH] Fix Gen7 compile if you have avr-libc version 1.7.1 or higher. See http://code.google.com/p/arduino/issues/detail?id=604 --- Marlin/Gen7/cores/arduino/wiring.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Marlin/Gen7/cores/arduino/wiring.h b/Marlin/Gen7/cores/arduino/wiring.h index 6309a364fc..48ff04a752 100644 --- a/Marlin/Gen7/cores/arduino/wiring.h +++ b/Marlin/Gen7/cores/arduino/wiring.h @@ -70,7 +70,9 @@ extern "C"{ #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))) +#if __AVR_LIBC_VERSION__ < 10701UL #define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5)) +#endif #define radians(deg) ((deg)*DEG_TO_RAD) #define degrees(rad) ((rad)*RAD_TO_DEG) #define sq(x) ((x)*(x))