Browse Source

Fix (re-)defines in HAL_ESP32 (#13780)

felixstorm 5 years ago
parent
commit
4a48b70c0b
2 changed files with 11 additions and 1 deletions
  1. 5
    0
      Marlin/src/HAL/HAL_ESP32/HAL.h
  2. 6
    1
      Marlin/src/HAL/HAL_ESP32/i2s.cpp

+ 5
- 0
Marlin/src/HAL/HAL_ESP32/HAL.h View File

@@ -30,13 +30,18 @@
30 30
 
31 31
 #include <stdint.h>
32 32
 
33
+// these are going to be re-defined in Arduino.h
33 34
 #undef DISABLED
34 35
 #undef M_PI
36
+#undef _BV
35 37
 
36 38
 #include <Arduino.h>
37 39
 
40
+// revert back to the correct (old) definition
38 41
 #undef DISABLED
39 42
 #define DISABLED(V...) DO(DIS,&&,V)
43
+// re-define in case Arduino.h has been skipped due to earlier inclusion (i.e. in Marlin\src\HAL\HAL_ESP32\i2s.cpp)
44
+#define _BV(b) (1UL << (b))
40 45
 
41 46
 #include "../shared/math_32bit.h"
42 47
 #include "../shared/HAL_SPI.h"

+ 6
- 1
Marlin/src/HAL/HAL_ESP32/i2s.cpp View File

@@ -21,7 +21,12 @@
21 21
  */
22 22
 #ifdef ARDUINO_ARCH_ESP32
23 23
 
24
-#include <Arduino.h> // replace that with the proper imports
24
+// replace that with the proper imports, then cleanup workarounds in Marlin\src\HAL\HAL_ESP32\HAL.h
25
+#include <Arduino.h>
26
+// revert back to the correct definition
27
+#undef DISABLED
28
+#define DISABLED(V...) DO(DIS,&&,V)
29
+
25 30
 #include "i2s.h"
26 31
 #include "../../core/macros.h"
27 32
 #include "driver/periph_ctrl.h"

Loading…
Cancel
Save