Browse Source

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

pull/1/head
felixstorm 6 years ago
committed by Scott Lahteine
parent
commit
4a48b70c0b
  1. 5
      Marlin/src/HAL/HAL_ESP32/HAL.h
  2. 7
      Marlin/src/HAL/HAL_ESP32/i2s.cpp

5
Marlin/src/HAL/HAL_ESP32/HAL.h

@ -30,13 +30,18 @@
#include <stdint.h> #include <stdint.h>
// these are going to be re-defined in Arduino.h
#undef DISABLED #undef DISABLED
#undef M_PI #undef M_PI
#undef _BV
#include <Arduino.h> #include <Arduino.h>
// revert back to the correct (old) definition
#undef DISABLED #undef DISABLED
#define DISABLED(V...) DO(DIS,&&,V) #define DISABLED(V...) DO(DIS,&&,V)
// re-define in case Arduino.h has been skipped due to earlier inclusion (i.e. in Marlin\src\HAL\HAL_ESP32\i2s.cpp)
#define _BV(b) (1UL << (b))
#include "../shared/math_32bit.h" #include "../shared/math_32bit.h"
#include "../shared/HAL_SPI.h" #include "../shared/HAL_SPI.h"

7
Marlin/src/HAL/HAL_ESP32/i2s.cpp

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

Loading…
Cancel
Save