Skip to content

Commit

Permalink
fixup! pkg/littlefs: make block size configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
fabian18 committed Jun 20, 2022
1 parent 14af053 commit 59a94eb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/littlefs/fs/littlefs_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,8 @@ static int prepare(littlefs_desc_t *fs)

size_t block_size = fs->dev->pages_per_sector * fs->dev->page_size;
#if LITTLEFS_MIN_BLOCK_SIZE_EXP >= 0
if (!(block_size = ((1u << LITTLEFS_MIN_BLOCK_SIZE_EXP) / block_size) * block_size)) {
block_size = fs->dev->pages_per_sector * fs->dev->page_size;
}
block_size = ((block_size - 1) + (1u << LITTLEFS_MIN_BLOCK_SIZE_EXP))
/ block_size * block_size;
#endif
fs->sectors_per_block = block_size / (fs->dev->pages_per_sector * fs->dev->page_size);
size_t block_count = fs->dev->sector_count / fs->sectors_per_block;
Expand Down

0 comments on commit 59a94eb

Please sign in to comment.