mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-27 18:02:17 +03:00
increase irom0 from 0x3C000 to 0x6B000 (+192KB) space
This commit is contained in:
@ -30,7 +30,7 @@
|
||||
#include "spi_flash.h"
|
||||
}
|
||||
|
||||
#define CONFIG_START_SECTOR 0x3C
|
||||
#define CONFIG_START_SECTOR 0x7b
|
||||
#define CONFIG_SECTOR (CONFIG_START_SECTOR + 0)
|
||||
#define CONFIG_ADDR (SPI_FLASH_SEC_SIZE * CONFIG_SECTOR)
|
||||
|
||||
@ -82,16 +82,23 @@ void EEPROMClass::write(int address, uint8_t value)
|
||||
_dirty = true;
|
||||
}
|
||||
|
||||
void EEPROMClass::commit()
|
||||
bool EEPROMClass::commit()
|
||||
{
|
||||
if (!_size || !_dirty)
|
||||
return;
|
||||
bool ret = false;
|
||||
if (!_size)
|
||||
return false;
|
||||
if(!_dirty)
|
||||
return true;
|
||||
|
||||
ETS_UART_INTR_DISABLE();
|
||||
spi_flash_erase_sector(CONFIG_SECTOR);
|
||||
spi_flash_write(CONFIG_ADDR, reinterpret_cast<uint32_t*>(_data), _size);
|
||||
if(spi_flash_erase_sector(CONFIG_SECTOR) == SPI_FLASH_RESULT_OK) {
|
||||
if(spi_flash_write(CONFIG_ADDR, reinterpret_cast<uint32_t*>(_data), _size) == SPI_FLASH_RESULT_OK) {
|
||||
_dirty = false;
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
ETS_UART_INTR_ENABLE();
|
||||
_dirty = false;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user