Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3/3] DMA Move API: Introduce DMA buffer objects #1856

Merged
merged 15 commits into from
Aug 20, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Preserve previous blocking semantics
Dominaezzz committed Aug 1, 2024
commit eee5dcb73e1a44395c07a0b7eed2d21f576c74af
10 changes: 5 additions & 5 deletions esp-hal/src/spi/master.rs
Original file line number Diff line number Diff line change
@@ -1099,8 +1099,8 @@ pub mod dma {
true
}

pub fn wait(self) -> (SpiDma<'d, T, C, M, DmaMode>, Buf) {
while !self.is_done() {}
pub fn wait(mut self) -> (SpiDma<'d, T, C, M, DmaMode>, Buf) {
self.spi_dma.spi.flush().ok();
fence(Ordering::Acquire);
(self.spi_dma, self.dma_buf)
}
@@ -1156,13 +1156,13 @@ pub mod dma {

let result = unsafe {
self.spi
.start_write_bytes_dma(buffer.first(), buffer.len(), &mut self.channel.tx)
.start_write_bytes_dma(buffer.first(), bytes_to_write, &mut self.channel.tx)
};
if let Err(e) = result {
return Err((e, self, buffer));
}

Ok(SpiDmaTransfer::new(self, buffer, true, false))
Ok(SpiDmaTransfer::new(self, buffer, false, true))
}

/// Perform a DMA read.
@@ -1190,7 +1190,7 @@ pub mod dma {
return Err((e, self, buffer));
}

Ok(SpiDmaTransfer::new(self, buffer, false, true))
Ok(SpiDmaTransfer::new(self, buffer, true, false))
}

/// Perform a DMA transfer
Loading