Skip to content

Commit 14c7cb4

Browse files
bors[bot]imihajlow
andauthored
Merge #545
545: DMA: add a method to wait for transfer completion r=burrbull a=imihajlow Co-authored-by: Ivan Mikhailov <[email protected]>
2 parents bf445ea + 1f9dd9f commit 14c7cb4

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
154154
- example of using USB CDC with interrupts.
155155
- Added non-blocking I2C based on DMA [#534]
156156
- Added Transactional I2C API [#542]
157+
- Added wait method for DMA Transfer.
157158

158159
[#481]: https://github.com/stm32-rs/stm32f4xx-hal/pull/481
159160
[#489]: https://github.com/stm32-rs/stm32f4xx-hal/pull/489

src/dma/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1365,6 +1365,12 @@ where
13651365
&mut self.stream
13661366
}
13671367

1368+
/// Wait for the transfer to complete.
1369+
#[inline(always)]
1370+
pub fn wait(&self) {
1371+
while !STREAM::get_transfer_complete_flag() {}
1372+
}
1373+
13681374
/// Applies all fields in DmaConfig.
13691375
fn apply_config(stream: &mut STREAM, config: config::DmaConfig) {
13701376
let msize = mem::size_of::<<PERIPHERAL as PeriAddress>::MemSize>() / 2;

0 commit comments

Comments
 (0)