From ef5377e3274c1beea1773e34adbb4960d38229d3 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Fri, 15 Mar 2019 11:25:02 +0100 Subject: [PATCH] Workaround NeoPixelBus STAGE compile error Workaround NeoPixelBus STAGE compile error --- .../src/internal/NeoEsp8266DmaMethod.h | 16 ++++++++++------ platformio.ini | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/NeoPixelBus-2.2.9/src/internal/NeoEsp8266DmaMethod.h b/lib/NeoPixelBus-2.2.9/src/internal/NeoEsp8266DmaMethod.h index af11e1a7a..dc4dd2723 100644 --- a/lib/NeoPixelBus-2.2.9/src/internal/NeoEsp8266DmaMethod.h +++ b/lib/NeoPixelBus-2.2.9/src/internal/NeoEsp8266DmaMethod.h @@ -48,7 +48,11 @@ extern "C" #include "ets_sys.h" #include "user_interface.h" +// Workaround STAGE compile error +#include +#if defined(ARDUINO_ESP8266_RELEASE_2_3_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_1) || defined(ARDUINO_ESP8266_RELEASE_2_4_2) || defined(ARDUINO_ESP8266_RELEASE_2_5_0) void rom_i2c_writeReg_Mask(uint32_t block, uint32_t host_id, uint32_t reg_add, uint32_t Msb, uint32_t Lsb, uint32_t indata); +#endif } struct slc_queue_item @@ -74,7 +78,7 @@ public: class NeoEsp8266DmaSpeed800Kbps { public: - const static uint32_t I2sClockDivisor = 3; + const static uint32_t I2sClockDivisor = 3; const static uint32_t I2sBaseClockDivisor = 16; const static uint32_t ResetTimeUs = 50; }; @@ -82,7 +86,7 @@ public: class NeoEsp8266DmaSpeed400Kbps { public: - const static uint32_t I2sClockDivisor = 6; + const static uint32_t I2sClockDivisor = 6; const static uint32_t I2sBaseClockDivisor = 16; const static uint32_t ResetTimeUs = 50; }; @@ -100,7 +104,7 @@ const uint8_t c_I2sPin = 3; // due to I2S hardware, the pin used is restricted t template class NeoEsp8266DmaMethodBase { public: - NeoEsp8266DmaMethodBase(uint16_t pixelCount, size_t elementSize) + NeoEsp8266DmaMethodBase(uint16_t pixelCount, size_t elementSize) { uint16_t dmaPixelSize = c_dmaBytesPerPixelBytes * elementSize; @@ -269,7 +273,7 @@ public: private: static NeoEsp8266DmaMethodBase* s_this; // for the ISR - size_t _pixelsSize; // Size of '_pixels' buffer + size_t _pixelsSize; // Size of '_pixels' buffer uint8_t* _pixels; // Holds LED color values uint32_t _i2sBufferSize; // total size of _i2sBuffer @@ -310,7 +314,7 @@ private: slc_queue_item* finished_item = (slc_queue_item*)SLCRXEDA; // data block has pending data waiting to send, prepare it - // point last state block to top + // point last state block to top (finished_item + 1)->next_link_ptr = (uint32_t)(s_this->_i2sBufDesc); s_this->_dmaState = NeoDmaState_Sending; @@ -367,7 +371,7 @@ private: } }; -template +template NeoEsp8266DmaMethodBase* NeoEsp8266DmaMethodBase::s_this; typedef NeoEsp8266DmaMethodBase NeoEsp8266DmaWs2813Method; diff --git a/platformio.ini b/platformio.ini index 5c52af18b..671a6f284 100644 --- a/platformio.ini +++ b/platformio.ini @@ -90,7 +90,7 @@ platform = https://github.com/platformio/platform-espressif8266 build_flags = ${esp82xx_defaults.build_flags} -Wl,-Teagle.flash.1m.ld ; nonos-sdk 22x - -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x + -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x ; nonos-sdk-pre-v3 ; -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK3 ; lwIP 1.4 (Default)