Skip to content

Commit

Permalink
https://github.com/geniusgogo/littlefs/commit/b5d27acbf965d5149e76407…
Browse files Browse the repository at this point in the history
…b04c2660ddcd0167e#diff-f760583e42c2270e40b514c73089180a
  • Loading branch information
xieyangrun committed Sep 12, 2020
1 parent 775b594 commit 8e5ebf8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dfs_lfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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->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);
if (lfs_cfg->lookahead_size > LFS_LOOKAHEAD_MAX)
Expand Down Expand Up @@ -524,7 +524,7 @@ static int _dfs_lfs_rename(struct dfs_filesystem* dfs, const char* from, const c

RT_ASSERT(dfs != RT_NULL);
RT_ASSERT(dfs->data != RT_NULL);

lfs_dfs_lock();
dfs_lfs = (dfs_lfs_t*)dfs->data;

Expand Down

0 comments on commit 8e5ebf8

Please sign in to comment.