Clean up spi
Remove uncommented spi::Write implementation
@@ -610,44 +610,3 @@ hal! {
SPI3: (spi3, APB1, spi3en, spi3rst, pclk1),
SPI4: (spi4, APB2, spi4en, spi4rst, pclk2),
}
-
-// FIXME not working
-// TODO measure if this actually faster than the default implementation
-// impl ::hal::blocking::spi::Write<u8> for Spi {
-// type Error = Error;
-
-// fn write(&mut self, bytes: &[u8]) -> Result<(), Error> {
-// for byte in bytes {
-// 'l: loop {
-// let sr = self.spi.sr.read();
-
-// // ignore overruns because we don't care about the incoming data
-// // if sr.ovr().bit_is_set() {
-// // Err(nb::Error::Other(Error::Overrun))
-// // } else
-// if sr.modf().bit_is_set() {
-// return Err(Error::ModeFault);
-// } else if sr.crcerr().bit_is_set() {
-// return Err(Error::Crc);
-// } else if sr.txe().bit_is_set() {
-// // NOTE(write_volatile) see note above
-// unsafe { ptr::write_volatile(&self.spi.dr as *const _ as *mut u8, *byte) }
-// break 'l;
-// } else {
-// // try again
-// }
-// }
-// }
-
-// // wait until the transmission of the last byte is done
-// while self.spi.sr.read().bsy().bit_is_set() {}
-
-// // clear OVR flag
-// unsafe {
-// ptr::read_volatile(&self.spi.dr as *const _ as *const u8);
-// }
-// self.spi.sr.read();
-
-// Ok(())
-// }
-// }
