Specify unit of the size members of the lfs_config struct

Fixes littlefs-project/littlefs#568
This commit is contained in:
Emilio Lopes
2021-10-29 11:16:06 +02:00
committed by Christopher Haster
parent ead50807f1
commit e29e7aeefa

22
lfs.h
View File

@@ -190,18 +190,18 @@ struct lfs_config {
int (*unlock)(const struct lfs_config *c); int (*unlock)(const struct lfs_config *c);
#endif #endif
// Minimum size of a block read. All read operations will be a // Minimum size of a block read in bytes. All read operations will be a
// multiple of this value. // multiple of this value.
lfs_size_t read_size; lfs_size_t read_size;
// Minimum size of a block program. All program operations will be a // Minimum size of a block program in bytes. All program operations will be
// multiple of this value. // a multiple of this value.
lfs_size_t prog_size; lfs_size_t prog_size;
// Size of an erasable block. This does not impact ram consumption and // Size of an erasable block in bytes. This does not impact ram consumption
// may be larger than the physical erase size. However, non-inlined files // and may be larger than the physical erase size. However, non-inlined
// take up at minimum one block. Must be a multiple of the read // files take up at minimum one block. Must be a multiple of the read and
// and program sizes. // program sizes.
lfs_size_t block_size; lfs_size_t block_size;
// Number of erasable blocks on the device. // Number of erasable blocks on the device.
@@ -215,11 +215,11 @@ struct lfs_config {
// Set to -1 to disable block-level wear-leveling. // Set to -1 to disable block-level wear-leveling.
int32_t block_cycles; int32_t block_cycles;
// Size of block caches. Each cache buffers a portion of a block in RAM. // Size of block caches in bytes. Each cache buffers a portion of a block in
// The littlefs needs a read cache, a program cache, and one additional // RAM. The littlefs needs a read cache, a program cache, and one additional
// cache per file. Larger caches can improve performance by storing more // cache per file. Larger caches can improve performance by storing more
// data and reducing the number of disk accesses. Must be a multiple of // data and reducing the number of disk accesses. Must be a multiple of the
// the read and program sizes, and a factor of the block size. // read and program sizes, and a factor of the block size.
lfs_size_t cache_size; lfs_size_t cache_size;
// Size of the lookahead buffer in bytes. A larger lookahead buffer // Size of the lookahead buffer in bytes. A larger lookahead buffer