Skip to content

Commit 3b1d6e5

Browse files
Bump littlefs2 to 0.4.0
1 parent 1c55b3b commit 3b1d6e5

4 files changed

Lines changed: 8 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919
- Added support for custom backends in `backend` module.
2020
- Added optional support for API extensions in `serde_extensions` module
2121
behind the `serde-extensions` feature.
22+
- Added `types::Path` re-export of `littlefs2::path::Path`.
2223

2324
### Changed
2425

@@ -28,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2829
- Replaced the client ID with a `ClientContext` struct.
2930
- Always trigger syscall in `PollClient::request` and remove
3031
`PollClient::syscall`.
32+
- Updated `littlefs2` to 0.4.0.
3133

3234
### Fixed
3335

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ delog = "0.1.0"
4242
cbor-smol = "0.4"
4343
heapless-bytes = { version = "0.3.0", features = ["cbor"] }
4444
interchange = "0.2.1"
45-
littlefs2 = "0.3.1"
45+
littlefs2 = "0.4.0"
4646
p256-cortex-m4 = { version = "0.1.0-alpha.5", features = ["prehash", "sec1-signatures"] }
4747
salty = { version = "0.2.0", features = ["cose"] }
4848
serde-indexed = "0.1.0"

src/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub use littlefs2::{
1111
driver::Storage as LfsStorage,
1212
fs::{DirEntry, Filesystem, Metadata},
1313
io::Result as LfsResult,
14-
path::PathBuf,
14+
path::{Path, PathBuf},
1515
};
1616

1717
use rand_core::{CryptoRng, RngCore};

src/virt/store.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::{
55
path::PathBuf,
66
};
77

8-
use generic_array::typenum::{U16, U512};
8+
use generic_array::typenum::{U8, U512};
99
use littlefs2::{const_ram_storage, driver::Storage, fs::Allocation};
1010

1111
use crate::{
@@ -53,15 +53,9 @@ impl Storage for FilesystemStorage {
5353
const BLOCK_CYCLES: isize = -1;
5454

5555
type CACHE_SIZE = U512;
56-
type LOOKAHEADWORDS_SIZE = U16;
57-
// TODO: This can't actually be changed currently
58-
// type FILENAME_MAX_PLUS_ONE = U256;
59-
// type PATH_MAX_PLUS_ONE = U256;
60-
// const FILEBYTES_MAX: usize = littlefs2::ll::LFS_FILE_MAX as _;
61-
// TODO: This can't actually be changed currently
62-
// type ATTRBYTES_MAX = U1022;
63-
64-
fn read(&self, offset: usize, buffer: &mut [u8]) -> LfsResult<usize> {
56+
type LOOKAHEAD_SIZE = U8;
57+
58+
fn read(&mut self, offset: usize, buffer: &mut [u8]) -> LfsResult<usize> {
6559
debug!("read: offset: {}, len: {}", offset, buffer.len());
6660
let mut file = File::open(&self.0).unwrap();
6761
file.seek(SeekFrom::Start(offset as _)).unwrap();

0 commit comments

Comments
 (0)