瀏覽代碼

Marlin must override _BV for 32-bit masks!

Scott Lahteine 7 年之前
父節點
當前提交
58671e1bc1
共有 3 個檔案被更改,包括 4 行新增5 行删除
  1. 1
    1
      Marlin/src/HAL/HAL_STM32F7/HAL_STM32F7.h
  2. 1
    1
      Marlin/src/HAL/HAL_STM32F7/fastio_STM32F7.h
  3. 2
    3
      Marlin/src/core/macros.h

+ 1
- 1
Marlin/src/HAL/HAL_STM32F7/HAL_STM32F7.h 查看文件

@@ -98,7 +98,7 @@
98 98
   #define NUM_SERIAL 1
99 99
 #endif
100 100
 
101
-#define _BV(bit) (1 << (bit))
101
+#define _BV(b) (1UL << (b))
102 102
 
103 103
 /**
104 104
  * TODO: review this to return 1 for pins that are not analog input

+ 1
- 1
Marlin/src/HAL/HAL_STM32F7/fastio_STM32F7.h 查看文件

@@ -29,7 +29,7 @@
29 29
 #ifndef _FASTIO_STM32F7_H
30 30
 #define _FASTIO_STM32F7_H
31 31
 
32
-#define _BV(bit) (1 << (bit))
32
+#define _BV(b) (1UL << (b))
33 33
 
34 34
 #define READ(IO)              digitalRead(IO)
35 35
 #define WRITE(IO, v)          digitalWrite(IO,v)

+ 2
- 3
Marlin/src/core/macros.h 查看文件

@@ -95,9 +95,8 @@
95 95
 #define STRINGIFY(M) STRINGIFY_(M)
96 96
 
97 97
 // Macros for bit masks
98
-#ifndef _BV
99
-  #define _BV(n)  (1<<(n))
100
-#endif
98
+#undef _BV // Marlin needs 32-bit unsigned!
99
+#define _BV(b) (1UL << (b))
101 100
 #define TEST(n,b) (((n)&_BV(b))!=0)
102 101
 #define SBI(n,b) (n |= _BV(b))
103 102
 #define CBI(n,b) (n &= ~_BV(b))

Loading…
取消
儲存