diff --git a/sonoff/_changelog.ino b/sonoff/_changelog.ino index e0bc4395a..8f3b232d7 100644 --- a/sonoff/_changelog.ino +++ b/sonoff/_changelog.ino @@ -3,6 +3,7 @@ * Fix missing white channel for WS2812 (#5869) * Add reset of Energy values when connection to sensor is lost for over 4 seconds (#5874, #5881) * Work-around for Philips Hue emulation issue (#5849) + * Add support to Stage Arduino Core (next 2.6.0) * * 6.5.0.12 20190521 * Add AriLux RF control GPIO option "ALux IrSel" (159) replacing "Led4i" (59) for full LED control (#5709) diff --git a/sonoff/settings.ino b/sonoff/settings.ino index 246b503b5..f2bf1290e 100644 --- a/sonoff/settings.ino +++ b/sonoff/settings.ino @@ -235,11 +235,20 @@ extern "C" { } #include "eboot_command.h" -extern "C" uint32_t _SPIFFS_end; +#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) || defined(ARDUINO_ESP8266_RELEASE_2_5_1) || defined(ARDUINO_ESP8266_RELEASE_2_5_2) +extern "C" uint32_t _SPIFFS_end; // From libraries/EEPROM/EEPROM.cpp EEPROMClass const uint32_t SPIFFS_END = ((uint32_t)&_SPIFFS_end - 0x40200000) / SPI_FLASH_SEC_SIZE; +#else // Core > 2.5.2 and STAGE + +extern "C" uint32_t _FS_end; +// From libraries/EEPROM/EEPROM.cpp EEPROMClass +const uint32_t SPIFFS_END = ((uint32_t)&_FS_end - 0x40200000) / SPI_FLASH_SEC_SIZE; + +#endif + // Version 4.2 config = eeprom area const uint32_t SETTINGS_LOCATION = SPIFFS_END; // No need for SPIFFS as it uses EEPROM area // Version 5.2 allow for more flash space