Skip to content

Commit a61eadb

Browse files
committed
Clean up spi
Remove uncommented spi::Write implementation
1 parent 85bc958 commit a61eadb

File tree

1 file changed

+0
-41
lines changed

1 file changed

+0
-41
lines changed

src/spi.rs

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -610,44 +610,3 @@ hal! {
610610
SPI3: (spi3, APB1, spi3en, spi3rst, pclk1),
611611
SPI4: (spi4, APB2, spi4en, spi4rst, pclk2),
612612
}
613-
614-
// FIXME not working
615-
// TODO measure if this actually faster than the default implementation
616-
// impl ::hal::blocking::spi::Write<u8> for Spi {
617-
// type Error = Error;
618-
619-
// fn write(&mut self, bytes: &[u8]) -> Result<(), Error> {
620-
// for byte in bytes {
621-
// 'l: loop {
622-
// let sr = self.spi.sr.read();
623-
624-
// // ignore overruns because we don't care about the incoming data
625-
// // if sr.ovr().bit_is_set() {
626-
// // Err(nb::Error::Other(Error::Overrun))
627-
// // } else
628-
// if sr.modf().bit_is_set() {
629-
// return Err(Error::ModeFault);
630-
// } else if sr.crcerr().bit_is_set() {
631-
// return Err(Error::Crc);
632-
// } else if sr.txe().bit_is_set() {
633-
// // NOTE(write_volatile) see note above
634-
// unsafe { ptr::write_volatile(&self.spi.dr as *const _ as *mut u8, *byte) }
635-
// break 'l;
636-
// } else {
637-
// // try again
638-
// }
639-
// }
640-
// }
641-
642-
// // wait until the transmission of the last byte is done
643-
// while self.spi.sr.read().bsy().bit_is_set() {}
644-
645-
// // clear OVR flag
646-
// unsafe {
647-
// ptr::read_volatile(&self.spi.dr as *const _ as *const u8);
648-
// }
649-
// self.spi.sr.read();
650-
651-
// Ok(())
652-
// }
653-
// }

0 commit comments

Comments
 (0)