forked from Imagelibrary/littlefs
Cleaned up block allocator
Removed scanning for stride - Adds complexity with questionable benefit - Can be added as an optimization later Fixed handling around device boundaries and where lookahead may not be a factor of the device size (consider small devices with only a few blocks) Added support for configuration with optional dynamic memory as found in the caching configuration
This commit is contained in:
@@ -70,6 +70,10 @@ uintmax_t res;
|
||||
#define LFS_BLOCK_COUNT 1024
|
||||
#endif
|
||||
|
||||
#ifndef LFS_LOOKAHEAD
|
||||
#define LFS_LOOKAHEAD 128
|
||||
#endif
|
||||
|
||||
const struct lfs_config cfg = {{
|
||||
.context = &bd,
|
||||
.read = &lfs_emubd_read,
|
||||
@@ -81,6 +85,7 @@ const struct lfs_config cfg = {{
|
||||
.prog_size = LFS_PROG_SIZE,
|
||||
.block_size = LFS_BLOCK_SIZE,
|
||||
.block_count = LFS_BLOCK_COUNT,
|
||||
.lookahead = LFS_LOOKAHEAD,
|
||||
}};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user