diff --git a/src/spi.rs b/src/spi.rs index 8d31fd8f..77c0b79c 100644 --- a/src/spi.rs +++ b/src/spi.rs @@ -400,7 +400,7 @@ where nb::Error::Other(Error::ModeFault) } else if sr.crcerr().bit_is_set() { nb::Error::Other(Error::Crc) - } else if sr.txe().bit_is_set() { + } else if sr.txe().bit_is_set() && sr.bsy().bit_is_clear() { return Ok(()); } else { nb::Error::WouldBlock @@ -482,7 +482,7 @@ where } // Do one last status register check before continuing - self.check_send().ok(); + nb::block!(self.check_send()).ok(); Ok(()) } } @@ -526,7 +526,7 @@ where } // Do one last status register check before continuing - self.check_send().ok(); + nb::block!(self.check_send()).ok(); Ok(()) } }