Skip to content

Commit b8e7f39

Browse files
thejpstereldruin
authored andcommitted
Fix example code.
Now you need blocking::spi::Write as well as blocking::spi::Transfer
1 parent 829d6d1 commit b8e7f39

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@
2424
//! # struct DummyDelayer;
2525
//! # impl embedded_hal::blocking::spi::Transfer<u8> for DummySpi {
2626
//! # type Error = ();
27-
//! # fn transfer<'w>(&mut self, data: &'w mut [u8]) -> Result<&'w [u8], ()> { Ok(&[0]) }
27+
//! # fn transfer<'w>(&mut self, data: &'w mut [u8]) -> Result<&'w [u8], Self::Error> { Ok(&[0]) }
28+
//! # }
29+
//! # impl embedded_hal::blocking::spi::Write<u8> for DummySpi {
30+
//! # type Error = ();
31+
//! # fn write(&mut self, data: &[u8]) -> Result<(), Self::Error> { Ok(()) }
2832
//! # }
2933
//! # impl embedded_hal::digital::v2::OutputPin for DummyCsPin {
3034
//! # type Error = ();

0 commit comments

Comments
 (0)