mirror of
https://github.com/eledio-devices/thirdparty-littlefs.git
synced 2025-11-01 08:48:31 +01:00
Compare commits
8 Commits
ci-revamp
...
bf_lfs_fil
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e955b9f65d | ||
|
|
ead50807f1 | ||
|
|
2f7596811d | ||
|
|
1e423bae58 | ||
|
|
3bee4d9a19 | ||
|
|
1863dc7883 | ||
|
|
3d4e4f2085 | ||
|
|
a2c744c8f8 |
@@ -192,7 +192,7 @@ More details on how littlefs works can be found in [DESIGN.md](DESIGN.md) and
|
||||
## Testing
|
||||
|
||||
The littlefs comes with a test suite designed to run on a PC using the
|
||||
[emulated block device](emubd/lfs_emubd.h) found in the emubd directory.
|
||||
[emulated block device](bd/lfs_testbd.h) found in the `bd` directory.
|
||||
The tests assume a Linux environment and can be started with make:
|
||||
|
||||
``` bash
|
||||
|
||||
12
lfs.c
12
lfs.c
@@ -2730,14 +2730,18 @@ static int lfs_file_outline(lfs_t *lfs, lfs_file_t *file) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef LFS_READONLY
|
||||
static int lfs_file_flush(lfs_t *lfs, lfs_file_t *file) {
|
||||
static void lfs_file_invalidate_reading_flag(lfs_t *lfs, lfs_file_t *file) {
|
||||
if (file->flags & LFS_F_READING) {
|
||||
if (!(file->flags & LFS_F_INLINE)) {
|
||||
lfs_cache_drop(lfs, &file->cache);
|
||||
}
|
||||
file->flags &= ~LFS_F_READING;
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef LFS_READONLY
|
||||
static int lfs_file_flush(lfs_t *lfs, lfs_file_t *file) {
|
||||
lfs_file_invalidate_reading_flag(lfs, file);
|
||||
|
||||
if (file->flags & LFS_F_WRITING) {
|
||||
lfs_off_t pos = file->pos;
|
||||
@@ -3087,6 +3091,10 @@ static lfs_soff_t lfs_file_rawseek(lfs_t *lfs, lfs_file_t *file,
|
||||
if (err) {
|
||||
return err;
|
||||
}
|
||||
#else
|
||||
// Seek doesn't update cache parameters properly.
|
||||
// It has to be invalidated otherwise next read will return incorrect values.
|
||||
lfs_file_invalidate_reading_flag(lfs,file);
|
||||
#endif
|
||||
|
||||
// update pos
|
||||
|
||||
2
lfs.h
2
lfs.h
@@ -22,7 +22,7 @@ extern "C"
|
||||
// Software library version
|
||||
// Major (top-nibble), incremented on backwards incompatible changes
|
||||
// Minor (bottom-nibble), incremented on feature additions
|
||||
#define LFS_VERSION 0x00020003
|
||||
#define LFS_VERSION 0x00020004
|
||||
#define LFS_VERSION_MAJOR (0xffff & (LFS_VERSION >> 16))
|
||||
#define LFS_VERSION_MINOR (0xffff & (LFS_VERSION >> 0))
|
||||
|
||||
|
||||
@@ -292,6 +292,8 @@ class TestCase:
|
||||
if e.errno == errno.EIO:
|
||||
break
|
||||
raise
|
||||
if not line:
|
||||
break;
|
||||
stdout.append(line)
|
||||
if args.get('verbose'):
|
||||
sys.stdout.write(line)
|
||||
@@ -687,6 +689,8 @@ def main(**args):
|
||||
if e.errno == errno.EIO:
|
||||
break
|
||||
raise
|
||||
if not line:
|
||||
break;
|
||||
stdout.append(line)
|
||||
if args.get('verbose'):
|
||||
sys.stdout.write(line)
|
||||
|
||||
Reference in New Issue
Block a user