From aaa420e52becf0aaaed91efc2f47a25e19a6a578 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Wed, 30 Oct 2019 16:51:13 +0100 Subject: [PATCH] Prep for core AUTOFLASHSIZE --- tasmota/settings.ino | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tasmota/settings.ino b/tasmota/settings.ino index c05935208..311d3108e 100644 --- a/tasmota/settings.ino +++ b/tasmota/settings.ino @@ -256,11 +256,22 @@ const uint32_t SPIFFS_END = ((uint32_t)&_SPIFFS_end - 0x40200000) / SPI_FLASH_SE #else // Core > 2.5.2 and STAGE +#if AUTOFLASHSIZE + +#include "flash_hal.h" + +// From libraries/EEPROM/EEPROM.cpp EEPROMClass +const uint32_t SPIFFS_END = (FS_end - 0x40200000) / SPI_FLASH_SEC_SIZE; + +#else + 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 +#endif // AUTOFLASHSIZE + +#endif // All cores < pre-2.6.0 // Version 4.2 config = eeprom area const uint32_t SETTINGS_LOCATION = SPIFFS_END; // No need for SPIFFS as it uses EEPROM area