diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b78c00..5ae6644 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Changes - Add `MAX_DIRS` and `MAX_FILES` generics to `Controller` to allow an arbitrary numbers of concurrent open directories and files. -- Add new constructor method `Controller::new_custom_max(block_device: D, timesource: T) -> Controller` +- Add new constructor method `Controller::new_with_limits(block_device: D, timesource: T) -> Controller` to create a `Controller` with custom limits. ## [Version 0.4.0](https://github.com/rust-embedded-community/embedded-sdmmc-rs/releases/tag/v0.4.0) diff --git a/README.md b/README.md index 2504a37..a47e22f 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ let mut cont: Controller< DummyTimeSource, 6, 12, -> = Controller::new_custom_max(block, time_source); +> = Controller::new_with_limits(block, time_source); ``` ## Supported features diff --git a/src/controller.rs b/src/controller.rs index 5a9c2c8..9a91e78 100644 --- a/src/controller.rs +++ b/src/controller.rs @@ -40,10 +40,10 @@ where /// files. /// /// This creates a Controller with default values - /// MAX_DIRS = 4, MAX_FILES = 4. Call `Controller::new_custom_max(block_device, timesource)` + /// MAX_DIRS = 4, MAX_FILES = 4. Call `Controller::new_with_limits(block_device, timesource)` /// if you need different limits. pub fn new(block_device: D, timesource: T) -> Controller { - Self::new_custom_max(block_device, timesource) + Self::new_with_limits(block_device, timesource) } } @@ -56,7 +56,10 @@ where /// Create a new Disk Controller using a generic `BlockDevice`. From this /// controller we can open volumes (partitions) and with those we can open /// files. - pub fn new_custom_max(block_device: D, timesource: T) -> Controller { + pub fn new_with_limits( + block_device: D, + timesource: T, + ) -> Controller { debug!("Creating new embedded-sdmmc::Controller"); Controller { block_device, diff --git a/src/lib.rs b/src/lib.rs index 2858802..6021832 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -461,7 +461,7 @@ mod tests { #[test] fn partition0() { let mut c: Controller = - Controller::new_custom_max(DummyBlockDevice, Clock); + Controller::new_with_limits(DummyBlockDevice, Clock); let v = c.get_volume(VolumeIdx(0)).unwrap(); assert_eq!(