소스 검색

Allow compile under Windows Subsystem for Linux (#15606)

Marcio T 4 년 전
부모
커밋
f6a799c7b3
2개의 변경된 파일9개의 추가작업 그리고 1개의 파일을 삭제
  1. 8
    0
      Marlin/src/HAL/HAL_AVR/HAL.h
  2. 1
    1
      Marlin/src/core/macros.h

+ 8
- 0
Marlin/src/HAL/HAL_AVR/HAL.h 파일 보기

@@ -38,6 +38,14 @@
38 38
 #include <avr/interrupt.h>
39 39
 #include <avr/io.h>
40 40
 
41
+#ifndef pgm_read_ptr
42
+  // Compatibility for avr-libc 1.8.0-4.1 included with Ubuntu for
43
+  // Windows Subsystem for Linux on Windows 10 as of 10/18/2019
44
+  #define pgm_read_ptr_far(address_long) (void*)__ELPM_word((uint32_t)(address_long)) 
45
+  #define pgm_read_ptr_near(address_short) (void*)__LPM_word((uint16_t)(address_short))
46
+  #define pgm_read_ptr(address_short) pgm_read_ptr_near(address_short)
47
+#endif
48
+
41 49
 // ------------------------
42 50
 // Defines
43 51
 // ------------------------

+ 1
- 1
Marlin/src/core/macros.h 파일 보기

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

Loading…
취소
저장