mirror of
				https://github.com/eledio-devices/thirdparty-littlefs.git
				synced 2025-10-31 08:42:40 +01:00 
			
		
		
		
	Changed lookahead configuration unit to bytes instead of bits
The fact that the lookahead buffer uses bits instead of bytes is an internal detail. Poking this through to the user API has caused a decent amount of confusion. Most buffers are provided as bytes and the inconsistency here can be surprising. The use of bytes instead of bits also makes us forward compatible in the case that we want to change the lookahead internal representation (hint segment list). Additionally, we change the configuration name to lookahead_size. This matches other configurations, such as cache_size and read_size, while also notifying the user that something important changed at compile time (by breaking).
This commit is contained in:
		| @@ -85,8 +85,8 @@ uintmax_t test; | ||||
| #define LFS_CACHE_SIZE 64 | ||||
| #endif | ||||
|  | ||||
| #ifndef LFS_LOOKAHEAD | ||||
| #define LFS_LOOKAHEAD 128 | ||||
| #ifndef LFS_LOOKAHEAD_SIZE | ||||
| #define LFS_LOOKAHEAD_SIZE 16 | ||||
| #endif | ||||
|  | ||||
| const struct lfs_config cfg = {{ | ||||
| @@ -96,13 +96,13 @@ const struct lfs_config cfg = {{ | ||||
|     .erase = &lfs_emubd_erase, | ||||
|     .sync  = &lfs_emubd_sync, | ||||
|  | ||||
|     .read_size    = LFS_READ_SIZE, | ||||
|     .prog_size    = LFS_PROG_SIZE, | ||||
|     .block_size   = LFS_BLOCK_SIZE, | ||||
|     .block_count  = LFS_BLOCK_COUNT, | ||||
|     .block_cycles = LFS_BLOCK_CYCLES, | ||||
|     .cache_size   = LFS_CACHE_SIZE, | ||||
|     .lookahead    = LFS_LOOKAHEAD, | ||||
|     .read_size      = LFS_READ_SIZE, | ||||
|     .prog_size      = LFS_PROG_SIZE, | ||||
|     .block_size     = LFS_BLOCK_SIZE, | ||||
|     .block_count    = LFS_BLOCK_COUNT, | ||||
|     .block_cycles   = LFS_BLOCK_CYCLES, | ||||
|     .cache_size     = LFS_CACHE_SIZE, | ||||
|     .lookahead_size = LFS_LOOKAHEAD_SIZE, | ||||
| }}; | ||||
|  | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user