|
24 | 24 | //! # struct DummyDelayer;
|
25 | 25 | //! # use embedded_hal::spi::Operation;
|
26 | 26 | //! # use embedded_hal::spi::ErrorType;
|
| 27 | +//! # use core::convert::Infallible; |
| 28 | +//! # use core::fmt; |
27 | 29 | //! # impl ErrorType for DummySpi {
|
28 |
| -//! # type Error = (); |
| 30 | +//! # type Error = Infallible; |
29 | 31 | //! # }
|
30 | 32 | //! # impl embedded_hal::spi::SpiDevice<u8> for DummySpi {
|
31 | 33 | //! #
|
|
50 | 52 | //! # }
|
51 | 53 | //! # }
|
52 | 54 | //! # impl embedded_hal::digital::ErrorType for DummyCsPin {
|
53 |
| -//! # type Error = (); |
| 55 | +//! # type Error = Infallible; |
54 | 56 | //! # }
|
55 | 57 | //! # impl embedded_hal::digital::OutputPin for DummyCsPin {
|
56 |
| -//! # fn set_low(&mut self) -> Result<(), ()> { Ok(()) } |
57 |
| -//! # fn set_high(&mut self) -> Result<(), ()> { Ok(()) } |
| 58 | +//! # fn set_low(&mut self) -> Result<(), Self::Error> { Ok(()) } |
| 59 | +//! # fn set_high(&mut self) -> Result<(), Self::Error> { Ok(()) } |
58 | 60 | //! # }
|
59 | 61 | //! # impl embedded_sdmmc::TimeSource for DummyTimeSource {
|
60 | 62 | //! # fn get_timestamp(&self) -> embedded_sdmmc::Timestamp { embedded_sdmmc::Timestamp::from_fat(0, 0) }
|
61 | 63 | //! # }
|
62 | 64 | //! # impl embedded_hal::delay::DelayUs for DummyDelayer {
|
63 |
| -//! # fn delay_us(&mut self, us: u8) {} |
| 65 | +//! # fn delay_us(&mut self, us: u32) {} |
64 | 66 | //! # }
|
65 |
| -//! # impl std::fmt::Write for DummyUart { |
66 |
| -//! # fn write_str(&mut self, s: &str) -> std::fmt::Result { Ok(()) } |
| 67 | +//! # impl fmt::Write for DummyUart { |
| 68 | +//! # fn write_str(&mut self, s: &str) -> fmt::Result { Ok(()) } |
67 | 69 | //! # }
|
68 |
| -//! # use std::fmt::Write; |
69 | 70 | //! # use embedded_sdmmc::VolumeManager;
|
70 | 71 | //! # fn main() -> Result<(), embedded_sdmmc::Error<embedded_sdmmc::SdCardError>> {
|
71 | 72 | //! # let mut sdmmc_spi = DummySpi;
|
|
74 | 75 | //! # let delayer = DummyDelayer;
|
75 | 76 | //! # let sdcard = embedded_sdmmc::SdCard::new(sdmmc_spi, sdmmc_cs, delayer);
|
76 | 77 | //! # println!("Card size is {} bytes", sdcard.num_bytes()?);
|
77 |
| -//! # let mut volume_mgr = embedded_sdmmc::VolumeManager::new(sdcard, time_source); |
| 78 | +//! # let mut volume_mgr = VolumeManager::new(sdcard, time_source); |
78 | 79 | //! # let mut volume0 = volume_mgr.open_volume(embedded_sdmmc::VolumeIdx(0))?;
|
79 | 80 | //! # println!("Volume 0: {:?}", volume0);
|
80 | 81 | //! # let mut root_dir = volume0.open_root_dir()?;
|
|
0 commit comments