1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-27 18:02:17 +03:00

Restore EEPROM address to prior released location (#6537)

When the FS_END was adjusted to end on a full block (i.e. rounded down)
to avoid filesystem issues, but _FS_end was changed.  The EEPROM library
used _FS_end to implicitly calculate the start of the EEPROM data, so
this means after the _FS_end fix, EEPROM data written with prior
releases would "disappear."

Avoid the issue by explicitly calculating the EEPROM start location in
the linker, using the same formula as prior release.

Fixes #6531
This commit is contained in:
Earle F. Philhower, III
2019-09-20 08:24:10 -07:00
committed by GitHub
parent 3733ece7e8
commit 69f3e81fb9
28 changed files with 34 additions and 3 deletions

View File

@ -30,7 +30,7 @@ extern "C" {
#include "spi_flash.h"
}
extern "C" uint32_t _FS_end;
extern "C" uint32_t _EEPROM_start;
EEPROMClass::EEPROMClass(uint32_t sector)
: _sector(sector)
@ -41,7 +41,7 @@ EEPROMClass::EEPROMClass(uint32_t sector)
}
EEPROMClass::EEPROMClass(void)
: _sector((((uint32_t)&_FS_end - 0x40200000) / SPI_FLASH_SEC_SIZE))
: _sector((((uint32_t)&_EEPROM_start - 0x40200000) / SPI_FLASH_SEC_SIZE))
, _data(0)
, _size(0)
, _dirty(false)