Try to fix the blocksize issues
This commit is contained in:
parent
c01f653736
commit
761c9dff7f
|
@ -73,7 +73,7 @@ static bool myspiffs_set_location(spiffs_config *cfg, int align, int offset, int
|
||||||
* Returns TRUE if FS was found
|
* Returns TRUE if FS was found
|
||||||
* align must be a power of two
|
* align must be a power of two
|
||||||
*/
|
*/
|
||||||
static bool myspiffs_set_cfg(spiffs_config *cfg, int align, int offset, bool force_create) {
|
static bool myspiffs_set_cfg_block(spiffs_config *cfg, int align, int offset, int block_size, bool force_create) {
|
||||||
cfg->phys_erase_block = INTERNAL_FLASH_SECTOR_SIZE; // according to datasheet
|
cfg->phys_erase_block = INTERNAL_FLASH_SECTOR_SIZE; // according to datasheet
|
||||||
cfg->log_page_size = LOG_PAGE_SIZE; // as we said
|
cfg->log_page_size = LOG_PAGE_SIZE; // as we said
|
||||||
|
|
||||||
|
@ -81,11 +81,9 @@ static bool myspiffs_set_cfg(spiffs_config *cfg, int align, int offset, bool for
|
||||||
cfg->hal_write_f = my_spiffs_write;
|
cfg->hal_write_f = my_spiffs_write;
|
||||||
cfg->hal_erase_f = my_spiffs_erase;
|
cfg->hal_erase_f = my_spiffs_erase;
|
||||||
|
|
||||||
if (!myspiffs_set_location(cfg, align, offset, LOG_BLOCK_SIZE)) {
|
if (!myspiffs_set_location(cfg, align, offset, block_size)) {
|
||||||
if (!myspiffs_set_location(cfg, align, offset, LOG_BLOCK_SIZE_SMALL_FS)) {
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
NODE_DBG("fs.start:%x,max:%x\n",cfg->phys_addr,cfg->phys_size);
|
NODE_DBG("fs.start:%x,max:%x\n",cfg->phys_addr,cfg->phys_size);
|
||||||
|
|
||||||
|
@ -109,6 +107,16 @@ static bool myspiffs_set_cfg(spiffs_config *cfg, int align, int offset, bool for
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool myspiffs_set_cfg(spiffs_config *cfg, int align, int offset, bool force_create) {
|
||||||
|
if (force_create) {
|
||||||
|
return myspiffs_set_cfg_block(cfg, align, offset, LOG_BLOCK_SIZE , TRUE) ||
|
||||||
|
myspiffs_set_cfg_block(cfg, align, offset, LOG_BLOCK_SIZE_SMALL_FS, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
return myspiffs_set_cfg_block(cfg, align, offset, LOG_BLOCK_SIZE_SMALL_FS, FALSE) ||
|
||||||
|
myspiffs_set_cfg_block(cfg, align, offset, LOG_BLOCK_SIZE , FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
static bool myspiffs_find_cfg(spiffs_config *cfg, bool force_create) {
|
static bool myspiffs_find_cfg(spiffs_config *cfg, bool force_create) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue