diff --git a/Marlin/src/HAL/HAL_DUE/HAL.h b/Marlin/src/HAL/HAL_DUE/HAL.h index 9430769734..40a0241905 100644 --- a/Marlin/src/HAL/HAL_DUE/HAL.h +++ b/Marlin/src/HAL/HAL_DUE/HAL.h @@ -68,10 +68,6 @@ #define strncpy_P(dest, src, num) strncpy((dest), (src), (num)) #endif -#ifndef vsnprintf_P - #define vsnprintf_P vsnprintf -#endif - // Fix bug in pgm_read_ptr #undef pgm_read_ptr #define pgm_read_ptr(addr) (*((void**)(addr))) diff --git a/Marlin/src/HAL/HAL_STM32F1/HAL.h b/Marlin/src/HAL/HAL_STM32F1/HAL.h index 5c6426538f..f0a4883504 100644 --- a/Marlin/src/HAL/HAL_STM32F1/HAL.h +++ b/Marlin/src/HAL/HAL_STM32F1/HAL.h @@ -28,10 +28,6 @@ #define CPU_32_BIT -#ifndef vsnprintf_P - #define vsnprintf_P vsnprintf -#endif - #include "../../core/macros.h" #include "../shared/Marduino.h" #include "../shared/math_32bit.h" diff --git a/Marlin/src/HAL/HAL_STM32F4/HAL.h b/Marlin/src/HAL/HAL_STM32F4/HAL.h index 0812761340..a31d6ec6ab 100644 --- a/Marlin/src/HAL/HAL_STM32F4/HAL.h +++ b/Marlin/src/HAL/HAL_STM32F4/HAL.h @@ -24,10 +24,6 @@ #define CPU_32_BIT -#ifndef vsnprintf_P - #define vsnprintf_P vsnprintf -#endif - #include "../shared/Marduino.h" #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" diff --git a/Marlin/src/HAL/shared/Marduino.h b/Marlin/src/HAL/shared/Marduino.h index d9440325f2..0b33641ba4 100644 --- a/Marlin/src/HAL/shared/Marduino.h +++ b/Marlin/src/HAL/shared/Marduino.h @@ -29,6 +29,7 @@ #undef M_PI // Redefined by all #undef _BV // Redefined by some #undef sq // Redefined by teensy3/wiring.h +#undef vsnprintf_P // Defined by avr/pgmspace.h in some platforms #include // NOTE: If included earlier then this line is a NOOP @@ -41,6 +42,10 @@ #undef sq #define sq(x) ((x)*(x)) +#ifndef vsnprintf_P + #define vsnprintf_P vsnprintf +#endif + #ifndef SBI #define SBI(A,B) (A |= (1 << (B))) #endif