1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-12 01:53:07 +03:00

flash-size agnostic builds (#6690)

* flash: mapping definition by sketch at runtime depending on flash chip size and user configuration
This commit is contained in:
david gauchard
2022-02-10 18:25:18 +01:00
committed by GitHub
parent 3027acaf11
commit f60defc3d3
22 changed files with 552 additions and 542 deletions

View File

@ -2,18 +2,26 @@
#define flash_hal_mock_h
#include <stdint.h>
#include <../../cores/esp8266/flash_hal.h>
#undef FS_start
#undef FS_end
#define FS_start 0
#define FS_end 0
extern "C"
{
extern uint32_t s_phys_addr;
extern uint32_t s_phys_size;
extern uint32_t s_phys_page;
extern uint32_t s_phys_block;
extern uint8_t* s_phys_data;
}
extern uint32_t s_phys_addr;
extern uint32_t s_phys_size;
extern uint32_t s_phys_page;
extern uint32_t s_phys_block;
extern uint8_t* s_phys_data;
extern int32_t flash_hal_read(uint32_t addr, uint32_t size, uint8_t *dst);
extern int32_t flash_hal_write(uint32_t addr, uint32_t size, const uint8_t *src);
extern int32_t flash_hal_erase(uint32_t addr, uint32_t size);
}
#endif

View File

@ -3,6 +3,8 @@
#include <stdint.h>
#include <string.h>
#include "flash_hal.h"
extern "C"
{
uint32_t s_phys_addr = 0;

View File

@ -32,7 +32,6 @@
#include <fcntl.h>
#include <unistd.h>
#include <cerrno>
#include "flash_hal_mock.h"
#define LITTLEFS_FILE_NAME "littlefs.bin"

View File

@ -23,7 +23,7 @@
#include <stddef.h>
#include <vector>
#include <FS.h>
#include "flash_hal_mock.h"
#include "flash_hal.h"
#define DEFAULT_LITTLEFS_FILE_NAME "littlefs.bin"

View File

@ -28,8 +28,6 @@
#include <unistd.h>
#include <cerrno>
#include "flash_hal_mock.h"
#define SPIFFS_FILE_NAME "spiffs.bin"
#pragma GCC diagnostic push

View File

@ -20,7 +20,7 @@
#include <stddef.h>
#include <vector>
#include <FS.h>
#include "flash_hal_mock.h"
#include "flash_hal.h"
#define DEFAULT_SPIFFS_FILE_NAME "spiffs.bin"