|
29 | 29 | open_files: [(VolumeIdx, Cluster); MAX_FILES], |
30 | 30 | } |
31 | 31 |
|
| 32 | +impl<D, T> Controller<D, T, 4, 4> |
| 33 | +where |
| 34 | + D: BlockDevice, |
| 35 | + T: TimeSource, |
| 36 | + <D as BlockDevice>::Error: core::fmt::Debug, |
| 37 | +{ |
| 38 | + /// Create a new Disk Controller using a generic `BlockDevice`. From this |
| 39 | + /// controller we can open volumes (partitions) and with those we can open |
| 40 | + /// files. |
| 41 | + /// |
| 42 | + /// This creates a Controller with default values |
| 43 | + /// MAX_DIRS = 4, MAX_FILES = 4. Call `Controller::new_custom_max(block_device, timesource)` |
| 44 | + /// if you need different limits. |
| 45 | + pub fn new(block_device: D, timesource: T) -> Controller<D, T, 4, 4> { |
| 46 | + Self::new_custom_max(block_device, timesource) |
| 47 | + } |
| 48 | +} |
| 49 | + |
32 | 50 | impl<D, T, const MAX_DIRS: usize, const MAX_FILES: usize> Controller<D, T, MAX_DIRS, MAX_FILES> |
33 | 51 | where |
34 | 52 | D: BlockDevice, |
|
38 | 56 | /// Create a new Disk Controller using a generic `BlockDevice`. From this |
39 | 57 | /// controller we can open volumes (partitions) and with those we can open |
40 | 58 | /// files. |
41 | | - pub fn new(block_device: D, timesource: T) -> Controller<D, T, MAX_DIRS, MAX_FILES> { |
| 59 | + pub fn new_custom_max(block_device: D, timesource: T) -> Controller<D, T, MAX_DIRS, MAX_FILES> { |
42 | 60 | debug!("Creating new embedded-sdmmc::Controller"); |
43 | 61 | Controller { |
44 | 62 | block_device, |
|
0 commit comments