Skip to content

Commit 4453816

Browse files
committed
Generated v2 prefixes
2 parents 4241f3b + adad0fb commit 4453816

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,11 @@ License Identifiers that are here available: http://spdx.org/licenses/
267267
to create images of the filesystem on your PC. Check if littlefs will fit
268268
your needs, create images for a later download to the target memory or
269269
inspect the content of a binary image of the target memory.
270-
270+
271+
- [littlefs-toy] - A command-line tool for creating and working with littlefs
272+
images. Uses syntax similar to tar command for ease of use. Supports working
273+
on littlefs images embedded inside another file (firmware image, etc).
274+
271275
- [littlefs2-rust] - A Rust wrapper for littlefs. This project allows you
272276
to use littlefs in a Rust-friendly API, reaping the benefits of Rust's memory
273277
safety and other guarantees.
@@ -321,6 +325,7 @@ License Identifiers that are here available: http://spdx.org/licenses/
321325
[littlefs-js]: https://github.com/geky/littlefs-js
322326
[littlefs-js-demo]:http://littlefs.geky.net/demo.html
323327
[littlefs-python]: https://pypi.org/project/littlefs-python/
328+
[littlefs-toy]: https://github.com/tjko/littlefs-toy
324329
[littlefs2-rust]: https://crates.io/crates/littlefs2
325330
[nim-littlefs]: https://github.com/Graveflo/nim-littlefs
326331
[chamelon]: https://github.com/yomimono/chamelon

lfs2.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ static int lfs2_bd_read(lfs2_t *lfs2,
9393
// bypass cache?
9494
diff = lfs2_aligndown(diff, lfs2->cfg->read_size);
9595
int err = lfs2->cfg->read(lfs2->cfg, block, off, data, diff);
96+
LFS2_ASSERT(err <= 0);
9697
if (err) {
9798
return err;
9899
}
@@ -739,6 +740,7 @@ static lfs2_stag_t lfs2_dir_getslice(lfs2_t *lfs2, const lfs2_mdir_t *dir,
739740
int err = lfs2_bd_read(lfs2,
740741
NULL, &lfs2->rcache, sizeof(ntag),
741742
dir->pair[0], off, &ntag, sizeof(ntag));
743+
LFS2_ASSERT(err <= 0);
742744
if (err) {
743745
return err;
744746
}
@@ -767,6 +769,7 @@ static lfs2_stag_t lfs2_dir_getslice(lfs2_t *lfs2, const lfs2_mdir_t *dir,
767769
err = lfs2_bd_read(lfs2,
768770
NULL, &lfs2->rcache, diff,
769771
dir->pair[0], off+sizeof(tag)+goff, gbuffer, diff);
772+
LFS2_ASSERT(err <= 0);
770773
if (err) {
771774
return err;
772775
}
@@ -1279,6 +1282,7 @@ static lfs2_stag_t lfs2_dir_fetchmatch(lfs2_t *lfs2,
12791282
if (err == LFS2_ERR_CORRUPT) {
12801283
break;
12811284
}
1285+
return err;
12821286
}
12831287

12841288
lfs2_fcrc_fromle32(&fcrc);
@@ -2264,7 +2268,7 @@ static int lfs2_dir_relocatingcommit(lfs2_t *lfs2, lfs2_mdir_t *dir,
22642268
}
22652269
}
22662270

2267-
if (dir->erased) {
2271+
if (dir->erased && dir->count < 0xff) {
22682272
// try to commit
22692273
struct lfs2_commit commit = {
22702274
.block = dir->pair[0],

0 commit comments

Comments
 (0)