Commit Graph
6 Commits
Author SHA1 Message Date
Nicolas Stalder b5309cea79 Streamline API. Available blocks. More documentation 2019-12-15 12:05:12 +01:00
Nicolas Stalder 7f2d6108c3 MountState is no longer needed. Same for MountError, MountResult 2019-12-14 23:03:23 +01:00
Nicolas Stalder f1883f4e93 BLOCK_SIZE can be a normal usize 2019-12-14 22:42:21 +01:00
Nicolas Stalder fa2cb4fee3 Rename traits.rs -> driver.rs, document Storage more 2019-12-13 22:48:43 +01:00
Nicolas Stalder cd6467822d Demonstrate that RamStorage can be deconstructed. Weird gotcha
In real usage, `Storage` will be implemented by a class wrapping
a device's flash peripheral. We may very well need access to this
peripheral outside of littlefs (e.g., to change startup bytes or
any other flash read/write operation).

One possible approach is to "release" the flash peripheral, drop
the Storage, and later recreate it again with the same peripheral.
`ram_storage!` now generates a `Ram`, which is not dropped and
plays the role of the flash peripheral and its backing flash.

Instead, `RamStorage` now stores a `&mut Ram`. The tests intend to
demonstrate that we can reconstruct `RamStorage` and continue to
work with a possibly even mounted filesystem.

The "weird gotcha" is that `assert_eq!(metadata.len(), n)` panics
on an `unwrap_err`, while `assert!(metadata.len() == n)` works.
2019-12-13 22:00:12 +01:00
Nicolas Stalder 7e99a992af Add some UI tests 2019-12-13 13:53:59 +01:00