Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
spiffs_init.c
1#include "espressif/esp_spiffs.h"
2
3
4#define FS1_FLASH_SIZE (128*1024)
5#define FS2_FLASH_SIZE (128*1024)
6
7#define FS1_FLASH_ADDR (1024*1024)
8#define FS2_FLASH_ADDR (1280*1024)
9
10#define SECTOR_SIZE (4*1024)
11#define LOG_BLOCK (SECTOR_SIZE)
12#define LOG_PAGE (128)
13
14#define FD_BUF_SIZE 32*4
15#define CACHE_BUF_SIZE (LOG_PAGE + 32)*8
16
17
18void ICACHE_FLASH_ATTR spiffs_init()
19{
20 struct esp_spiffs_config config;
21
22 config.phys_size = 128 * 1024;
23 config.phys_addr = 1024 * 1024;
24 config.phys_erase_block = 4*1024;
25 config.log_block_size = 4*1024;
26 config.log_page_size = 128;
27 config.fd_buf_size = FD_BUF_SIZE * 2;
28 config.cache_buf_size = CACHE_BUF_SIZE;
29
30 int r = esp_spiffs_init(&config);
31 printf("spiffs_init: %d\n", r);
32}
#define ICACHE_FLASH_ATTR
Declares (on the ESP8266) that the current function is not executed too often and should be placed in...
Definition macros.h:222