Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
761c9dff
Commit
761c9dff
authored
Jul 06, 2017
by
philip
Browse files
Try to fix the blocksize issues
parent
c01f6537
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/spiffs/spiffs.c
View file @
761c9dff
...
...
@@ -73,7 +73,7 @@ static bool myspiffs_set_location(spiffs_config *cfg, int align, int offset, int
* Returns TRUE if FS was found
* 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
->
log_page_size
=
LOG_PAGE_SIZE
;
// as we said
...
...
@@ -81,10 +81,8 @@ static bool myspiffs_set_cfg(spiffs_config *cfg, int align, int offset, bool for
cfg
->
hal_write_f
=
my_spiffs_write
;
cfg
->
hal_erase_f
=
my_spiffs_erase
;
if
(
!
myspiffs_set_location
(
cfg
,
align
,
offset
,
LOG_BLOCK_SIZE
))
{
if
(
!
myspiffs_set_location
(
cfg
,
align
,
offset
,
LOG_BLOCK_SIZE_SMALL_FS
))
{
return
FALSE
;
}
if
(
!
myspiffs_set_location
(
cfg
,
align
,
offset
,
block_size
))
{
return
FALSE
;
}
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
}
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
)
{
int
i
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment