Browse Source

Merge pull request #6 from qiyongzhong0/fix-bug

[fix|bug]Modify the calculation method of "lfs_cfg -> block_count" in the "dfs…
geniusgogo 6 years ago
parent
commit
f31442a2a2
1 changed files with 1 additions and 1 deletions
  1. 1 1
      dfs_lfs.c

+ 1 - 1
dfs_lfs.c

@@ -236,7 +236,7 @@ static void _lfs_load_config(struct lfs_config* lfs_cfg, struct rt_mtd_nor_devic
     lfs_cfg->cache_size = LFS_CACHE_SIZE;
     lfs_cfg->cache_size = LFS_CACHE_SIZE;
     lfs_cfg->block_cycles = LFS_BLOCK_CYCLES;
     lfs_cfg->block_cycles = LFS_BLOCK_CYCLES;
 
 
-    lfs_cfg->block_count = mtd_nor->block_end - mtd_nor->block_start;
+    lfs_cfg->block_count = (mtd_nor->block_end - mtd_nor->block_start)*mtd_nor->block_size/lfs_cfg->block_size;
 
 
     lfs_cfg->lookahead_size = 32 * ((lfs_cfg->block_count + 31) / 32);
     lfs_cfg->lookahead_size = 32 * ((lfs_cfg->block_count + 31) / 32);
     if (lfs_cfg->lookahead_size > LFS_LOOKAHEAD_MAX)
     if (lfs_cfg->lookahead_size > LFS_LOOKAHEAD_MAX)