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

This commit is contained in:
felixstorm 2019-04-22 00:14:38 +02:00 committed by Scott Lahteine
parent 44216749c6
commit 4a48b70c0b
2 changed files with 11 additions and 1 deletions

View File

@ -30,13 +30,18 @@
#include <stdint.h>
// these are going to be re-defined in Arduino.h
#undef DISABLED
#undef M_PI
#undef _BV
#include <Arduino.h>
// revert back to the correct (old) definition
#undef DISABLED
#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/HAL_SPI.h"

View File

@ -21,7 +21,12 @@
*/
#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 "../../core/macros.h"
#include "driver/periph_ctrl.h"