Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -30,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
`PollClient::syscall`.
- Upgrade the `interchange` dependency to version 0.3.0 ([#99][])
- As a consequence the type `pipe::TrussedInterchange` becomes a const`pipe::TRUSSED_INTERCHANGE`
- Updated `littlefs2` to 0.4.0.

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ delog = "0.1.0"
cbor-smol = "0.4"
heapless-bytes = { version = "0.3.0", features = ["cbor"] }
interchange = "0.3.0"
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"
Expand Down
4 changes: 0 additions & 4 deletions rust-toolchain.toml

This file was deleted.

2 changes: 1 addition & 1 deletion src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
14 changes: 4 additions & 10 deletions src/virt/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{
path::PathBuf,
};

use generic_array::typenum::{U16, U512};
use generic_array::typenum::{U512, U8};
use littlefs2::{const_ram_storage, driver::Storage, fs::Allocation};

use crate::{
Expand Down Expand Up @@ -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<usize> {
type LOOKAHEAD_SIZE = U8;

fn read(&mut self, offset: usize, buffer: &mut [u8]) -> LfsResult<usize> {
debug!("read: offset: {}, len: {}", offset, buffer.len());
let mut file = File::open(&self.0).unwrap();
file.seek(SeekFrom::Start(offset as _)).unwrap();
Expand Down