Skip to content

Commit a91e1da

Browse files
authored
Merge branch 'master' into defmt_1.x
2 parents 9673793 + cb1f73e commit a91e1da

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

  • embedded-hal-bus/src/spi

embedded-hal-bus/src/spi/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! `SpiDevice` implementations.
22
3+
use core::convert::Infallible;
34
use core::fmt::{self, Debug, Display, Formatter};
45
use embedded_hal::spi::{Error, ErrorKind};
56

@@ -63,6 +64,15 @@ where
6364
}
6465
}
6566

67+
impl From<DeviceError<Infallible, Infallible>> for Infallible {
68+
fn from(value: DeviceError<Infallible, Infallible>) -> Self {
69+
match value {
70+
DeviceError::Spi(e) => e,
71+
DeviceError::Cs(e) => e,
72+
}
73+
}
74+
}
75+
6676
/// Dummy [`DelayNs`](embedded_hal::delay::DelayNs) implementation that panics on use.
6777
#[derive(Copy, Clone, Eq, PartialEq, Debug)]
6878
#[cfg_attr(feature = "defmt", derive(defmt::Format))]

0 commit comments

Comments
 (0)