diff --git a/CHANGELOG.md b/CHANGELOG.md index c4988086e06..33b8704bebd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added support for custom backends in `backend` module. - Added optional support for API extensions in `serde_extensions` module behind the `serde-extensions` feature. +- Added `types::Path` re-export of `littlefs2::path::Path`. ### Changed @@ -28,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Replaced the client ID with a `ClientContext` struct. - Always trigger syscall in `PollClient::request` and remove `PollClient::syscall`. +- Updated `littlefs2` to 0.4.0. ### Fixed diff --git a/Cargo.toml b/Cargo.toml index 2ee451e9a79..5c5e4bf2dc4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,7 +42,7 @@ delog = "0.1.0" cbor-smol = "0.4" heapless-bytes = { version = "0.3.0", features = ["cbor"] } interchange = "0.2.1" -littlefs2 = "0.3.1" +littlefs2 = "0.4.0" p256-cortex-m4 = { version = "0.1.0-alpha.5", features = ["prehash", "sec1-signatures"] } salty = { version = "0.2.0", features = ["cose"] } serde-indexed = "0.1.0" diff --git a/src/types.rs b/src/types.rs index c32f7c16562..d697e9b397e 100644 --- a/src/types.rs +++ b/src/types.rs @@ -11,7 +11,7 @@ pub use littlefs2::{ driver::Storage as LfsStorage, fs::{DirEntry, Filesystem, Metadata}, io::Result as LfsResult, - path::PathBuf, + path::{Path, PathBuf}, }; use rand_core::{CryptoRng, RngCore}; diff --git a/src/virt/store.rs b/src/virt/store.rs index 2e1589cf598..a23f8bc99dc 100644 --- a/src/virt/store.rs +++ b/src/virt/store.rs @@ -5,7 +5,7 @@ use std::{ path::PathBuf, }; -use generic_array::typenum::{U16, U512}; +use generic_array::typenum::{U8, U512}; use littlefs2::{const_ram_storage, driver::Storage, fs::Allocation}; use crate::{ @@ -53,15 +53,9 @@ impl Storage for FilesystemStorage { const BLOCK_CYCLES: isize = -1; type CACHE_SIZE = U512; - type LOOKAHEADWORDS_SIZE = U16; - // TODO: This can't actually be changed currently - // type FILENAME_MAX_PLUS_ONE = U256; - // type PATH_MAX_PLUS_ONE = U256; - // const FILEBYTES_MAX: usize = littlefs2::ll::LFS_FILE_MAX as _; - // TODO: This can't actually be changed currently - // type ATTRBYTES_MAX = U1022; - - fn read(&self, offset: usize, buffer: &mut [u8]) -> LfsResult { + type LOOKAHEAD_SIZE = U8; + + fn read(&mut self, offset: usize, buffer: &mut [u8]) -> LfsResult { debug!("read: offset: {}, len: {}", offset, buffer.len()); let mut file = File::open(&self.0).unwrap(); file.seek(SeekFrom::Start(offset as _)).unwrap();