8000 Add LittleFS as an optional filesystem, API compatible w/SPIFFS (but not on-flash-format compatible) by earlephilhower · Pull Request #5511 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

Add LittleFS as an optional filesystem, API compatible w/SPIFFS (but not on-flash-format compatible) #5511

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 40 commits into from
May 25, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
cd03a6f
Add LittleFS as internal flash filesystem
earlephilhower Dec 15, 2018
3d24167
Merge branch 'master' into littlefs
earlephilhower Jan 7, 2019
c22b9d4
Fix up merge blank line issue
Jan 7, 2019
a42bc48
Merge in the FSConfig changs from SDFS PR
Jan 7, 2019
8016386
Merge branch 'master' into littlefs
earlephilhower Jan 9, 2019
4acc649
Merge branch 'master' into littlefs
earlephilhower Feb 27, 2019
e3e8de3
Fix merge errors
earlephilhow 8000 er Feb 27, 2019
13e985c
Update to use v2-alpha branch
earlephilhower Mar 1, 2019
3340b95
V2 of littlefs is now in upstream/master
earlephilhower Apr 11, 2019
31e925a
Update test to support non-creation-ordered files
earlephilhower Apr 11, 2019
49f4618
Merge branch 'master' of https://github.com/esp8266/Arduino into litt…
earlephilhower Apr 11, 2019
ddafe05
Fix LittleFS.truncate implementation
earlephilhower Apr 11, 2019
da1383c
Merge branch 'master' into littlefs
earlephilhower Apr 11, 2019
d7fe68d
Fix SDFS tests
earlephilhower Apr 12, 2019
90ea0ba
Merge branch 'master' into littlefs
earlephilhower Apr 12, 2019
c3ac058
Update to point to mklittlefs v2
earlephilhower Apr 12, 2019
e3e6860
Remove extra FS::write(const char *s) method
earlephilhower Apr 12, 2019
4a827a5
Minimize spurious differences from master
earlephilhower Apr 12, 2019
0874498
Dramatically reduce memory usage
earlephilhower Apr 14, 2019
6b33dcf
Merge branch 'master' into littlefs
earlephilhower Apr 14, 2019
dc3e14a
Add @d-a-v's host emulation for LittleFS
earlephilhower Apr 15, 2019
7435409
Merge branch 'master' into littlefs
earlephilhower Apr 15, 2019
6f9ac16
Fix SW Serial library version
earlephilhower Apr 15, 2019
9d2ffed
Merge branch 'master' into littlefs
earlephilhower Apr 18, 2019
78fbb64
Fix free space reporting
earlephilhower Apr 18, 2019
88a9cf6
Update littlefs to latest upstream
earlephilhower Apr 23, 2019
c0594ef
Merge branch 'master' into littlefs
earlephilhower Apr 23, 2019
7bdfaf0
Remove sdfat version included by accident
earlephilhower May 1, 2019
fbe1d48
Merge branch 'master' into littlefs
earlephilhower May 1, 2019
f0fb051
Update SDFAT to include MOCK changes required
earlephilhower May 1, 2019
d1666e5
Merge branch 'master' into littlefs
earlephilhower May 1, 2019
8e732d2
Merge branch 'master' into littlefs
earlephilhower May 2, 2019
e7d5a45
Merge branch 'master' into littlefs
earlephilhower May 12, 2019
a70facc
Merge branch 'master' of https://github.com/esp8266/Arduino into litt…
earlephilhower May 12, 2019
a6d17e3
Merge branch 'littlefs' of https://github.com/earlephilhower/Arduino …
earlephilhower May 13, 2019
3ab6d76
Merge branch 'master' into littlefs
earlephilhower May 13, 2019
e016613
Update to include SD.h test of file append
earlephilhower May 17, 2019
edbd1ba
Merge branch 'master' into littlefs
earlephilhower May 17, 2019
bd57b00
Merge branch 'master' into littlefs
earlephilhower May 20, 2019
bf06492
Merge branch 'master' into littlefs
d-a-v May 24, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update to use v2-alpha branch
The V2-alpha branch supports small file optimizations which can help
increase the utilization of flash when small files are prevalent.
It also adds support for metadata, which means we can start adding
things like file creation times, if desired (not yet).
  • Loading branch information
earlephilhower committed Mar 1, 2019
commit 13e985c0675328707f97d6f65b011736cc6f2d45
2 changes: 1 addition & 1 deletion libraries/LittleFS/lib/littlefs
18 changes: 7 additions & 11 deletions libraries/LittleFS/src/LittleFS.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,15 @@ class LittleFSImpl : public FSImpl
_lfs_cfg.prog_size = _pageSize;
_lfs_cfg.block_size = _blockSize;
_lfs_cfg.block_count = _size / _blockSize;
_lfs_cfg.lookahead = 256;
_lfs_cfg.block_cycles = 16; // TODO - need better explanation
_lfs_cfg.cache_size = _blockSize;
_lfs_cfg.lookahead_size = 256;
_lfs_cfg.read_buffer = nullptr;
_lfs_cfg.prog_buffer = nullptr;
_lfs_cfg.lookahead_buffer = nullptr;
_lfs_cfg.file_buffer = nullptr;
_lfs_cfg.name_max = 0;
_lfs_cfg.file_max = 0;
_lfs_cfg.attr_max = 0;
}

~LittleFSImpl() {
Expand Down Expand Up @@ -234,19 +238,11 @@ class LittleFSImpl : public FSImpl
return _mounted;
}

static int _lfs_traverse_cb(void *p, lfs_block_t b) {
(void) b;
*(lfs_size_t *)p += 1;
return 0;
}

int _getUsedBlocks() {
lfs_size_t in_use = 0;
if (!_mounted) {
return 0;
}
int err = lfs_traverse(&_lfs, _lfs_traverse_cb, &in_use);
return err ? 0 : in_use;
return lfs_fs_size(&_lfs);
}

static int _getFlags(OpenMode openMode, AccessMode accessMode) {
Expand Down
0