diff --git a/Marlin/src/HAL/HAL_AVR/HAL.h b/Marlin/src/HAL/HAL_AVR/HAL.h index 246353677f..e83176918c 100644 --- a/Marlin/src/HAL/HAL_AVR/HAL.h +++ b/Marlin/src/HAL/HAL_AVR/HAL.h @@ -38,6 +38,14 @@ #include #include +#ifndef pgm_read_ptr + // Compatibility for avr-libc 1.8.0-4.1 included with Ubuntu for + // Windows Subsystem for Linux on Windows 10 as of 10/18/2019 + #define pgm_read_ptr_far(address_long) (void*)__ELPM_word((uint32_t)(address_long)) + #define pgm_read_ptr_near(address_short) (void*)__LPM_word((uint16_t)(address_short)) + #define pgm_read_ptr(address_short) pgm_read_ptr_near(address_short) +#endif + // ------------------------ // Defines // ------------------------ diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index b93bae79f6..03deea89dc 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -279,7 +279,7 @@ #define ATAN2(y, x) atan2f(y, x) #define POW(x, y) powf(x, y) #define SQRT(x) sqrtf(x) -#define RSQRT(x) (1 / sqrtf(x)) +#define RSQRT(x) (1.0f / sqrtf(x)) #define CEIL(x) ceilf(x) #define FLOOR(x) floorf(x) #define LROUND(x) lroundf(x)