diff --git a/esp-hal/src/spi/master.rs b/esp-hal/src/spi/master.rs index 67f4a0c346..c70e07b3f4 100644 --- a/esp-hal/src/spi/master.rs +++ b/esp-hal/src/spi/master.rs @@ -1434,7 +1434,12 @@ mod dma { fn drop(&mut self) { if !self.is_done() { self.spi_dma.cancel_transfer(); - self.spi_dma.wait_for_idle() + self.spi_dma.wait_for_idle(); + + unsafe { + ManuallyDrop::drop(&mut self.spi_dma); + ManuallyDrop::drop(&mut self.dma_buf); + } } } }