Minor improvement to documentation over block_cycles

Suggested by haneefmubarak
This commit is contained in:
Christopher Haster
2019-07-28 20:42:13 -05:00
parent 53a6e04712
commit 38a2a8d2a3
2 changed files with 11 additions and 6 deletions

10
lfs.c
View File

@@ -3192,11 +3192,15 @@ static int lfs_init(lfs_t *lfs, const struct lfs_config *cfg) {
LFS_ASSERT(4*lfs_npw2(0xffffffff / (lfs->cfg->block_size-2*4))
<= lfs->cfg->block_size);
// block_cycles = 0 is no longer supported, must either set a number
// of erase cycles before moving logs to another block (~500 suggested),
// or explicitly disable wear-leveling with -1.
// block_cycles = 0 is no longer supported.
//
// block_cycles is the number of erase cycles before littlefs evicts
// metadata logs as a part of wear leveling. Suggested values are in the
// range of 100-1000, or set block_cycles to -1 to disable block-level
// wear-leveling.
LFS_ASSERT(lfs->cfg->block_cycles != 0);
// setup read cache
if (lfs->cfg->read_buffer) {
lfs->rcache.buffer = lfs->cfg->read_buffer;