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:
@ -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
|
@ -3,6 +3,8 @@
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "flash_hal.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
uint32_t s_phys_addr = 0;
|
||||
|
@ -32,7 +32,6 @@
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <cerrno>
|
||||
#include "flash_hal_mock.h"
|
||||
|
||||
#define LITTLEFS_FILE_NAME "littlefs.bin"
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
@ -28,8 +28,6 @@
|
||||
#include <unistd.h>
|
||||
#include <cerrno>
|
||||
|
||||
#include "flash_hal_mock.h"
|
||||
|
||||
#define SPIFFS_FILE_NAME "spiffs.bin"
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
|
@ -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"
|
||||
|
||||
|
Reference in New Issue
Block a user