forked from zephyrproject-rtos/zephyr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
littlefs is a fail-safe filesystem from ARM Mbed that has wear-leveling capabilities. Signed-off-by: Peter A. Bigot <[email protected]> Signed-off-by: Jim Paris <[email protected]>
- Loading branch information
1 parent
b8be48e
commit fb73fcd
Showing
8 changed files
with
781 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,7 @@ enum fs_dir_entry_type { | |
enum fs_type { | ||
FS_FATFS = 0, | ||
FS_NFFS, | ||
FS_LITTLEFS, | ||
FS_TYPE_END, | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright (c) 2019 Bolt Innovation Management, LLC | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#ifndef ZEPHYR_INCLUDE_FS_LITTLEFS_H_ | ||
#define ZEPHYR_INCLUDE_FS_LITTLEFS_H_ | ||
|
||
#include <zephyr/types.h> | ||
#include <kernel.h> | ||
#include <storage/flash_map.h> | ||
|
||
#include <lfs.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** @brief Filesystem info structure for LittleFS mount */ | ||
struct fs_littlefs { | ||
/* These structures are filled automatically at mount. */ | ||
struct lfs lfs; | ||
struct lfs_config cfg; | ||
const struct flash_area *area; | ||
struct k_mutex mutex; | ||
|
||
/* Static buffers */ | ||
u8_t read_buffer[CONFIG_FS_LITTLEFS_CACHE_SIZE]; | ||
u8_t prog_buffer[CONFIG_FS_LITTLEFS_CACHE_SIZE]; | ||
/* Multiple of 8 bytes, but 4-byte aligned (littlefs #239) */ | ||
u32_t lookahead_buffer[CONFIG_FS_LITTLEFS_LOOKAHEAD_SIZE / sizeof(u32_t)]; | ||
}; | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* ZEPHYR_INCLUDE_FS_LITTLEFS_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.