1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00
esp8266/tools/sdk/include/spi_flash_geometry.h
Drzony 79ea883fb3
New flash writing method with offset/memory/size alignment handling (#7514)
* Do not write more data than requested on PUYA flashes

* Always align flash reads/writes to 4 bytes

* fixup! Always align flash reads/writes to 4 bytes

This commit simplifies the code a bit and fixes a bug that caused wrong number of bytes to be
written

* fixup! Always align flash reads/writes to 4 bytes

* fixup! Always align flash reads/writes to 4 bytes

* Check for result before additional read/write

* Add overloads for unaligned reads/writes

* fixup! Add overloads for unaligned reads/writes

* fixup! Add overloads for unaligned reads/writes

* fixup! Add overloads for unaligned reads/writes

* fixup! Add overloads for unaligned reads/writes

* fixup! Add overloads for unaligned reads/writes

* fixup! Add overloads for unaligned reads/writes

* fixup! Add overloads for unaligned reads/writes

* Add tests for flashRead/flashWrite

* fixup! Add overloads for unaligned reads/writes

* fixup! Add tests for flashRead/flashWrite

* fixup! Add tests for flashRead/flashWrite

* fixup! Add overloads for unaligned reads/writes
2020-10-14 22:21:41 -07:00

17 lines
534 B
C

#ifndef SPI_FLASH_GEOMETRY_H
#define SPI_FLASH_GEOMETRY_H
/* The flash geometry is meant to be unified here. This header file should be included wherever needed.
* Beware: this file is needed by eboot as well as the Arduino core.
*/
#define FLASH_SECTOR_SIZE 0x1000
#define FLASH_BLOCK_SIZE 0x10000
#define FLASH_PAGE_SIZE 0x100
#define APP_START_OFFSET 0x1000
//pulled this define from spi_flash.h for reuse in the Arduino core without pulling in a bunch of other stuff
#define SPI_FLASH_SEC_SIZE FLASH_SECTOR_SIZE
#endif