Browse Source

Allow compile under Windows Subsystem for Linux (#15606)

pull/1/head
Marcio T 5 years ago
committed by Scott Lahteine
parent
commit
f6a799c7b3
  1. 8
      Marlin/src/HAL/HAL_AVR/HAL.h
  2. 2
      Marlin/src/core/macros.h

8
Marlin/src/HAL/HAL_AVR/HAL.h

@ -38,6 +38,14 @@
#include <avr/interrupt.h> #include <avr/interrupt.h>
#include <avr/io.h> #include <avr/io.h>
#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 // Defines
// ------------------------ // ------------------------

2
Marlin/src/core/macros.h

@ -279,7 +279,7 @@
#define ATAN2(y, x) atan2f(y, x) #define ATAN2(y, x) atan2f(y, x)
#define POW(x, y) powf(x, y) #define POW(x, y) powf(x, y)
#define SQRT(x) sqrtf(x) #define SQRT(x) sqrtf(x)
#define RSQRT(x) (1 / sqrtf(x)) #define RSQRT(x) (1.0f / sqrtf(x))
#define CEIL(x) ceilf(x) #define CEIL(x) ceilf(x)
#define FLOOR(x) floorf(x) #define FLOOR(x) floorf(x)
#define LROUND(x) lroundf(x) #define LROUND(x) lroundf(x)

Loading…
Cancel
Save