Skip to content

Commit f718a51

Browse files
committed
DMA: Fix docs and bump embedded-dma minor version
1 parent 9cd6a2e commit f718a51

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
4545
- Allow implementations for DMASet from outside the crate [#237]
4646
- DMA: Make it possible to create the wrapper types for the timers [#237]
4747
- DMA: Fix some `compiler_fences` [#237]
48+
- DMA: Fix docs [#237]
4849

4950
[#237]: https://github.com/stm32-rs/stm32f4xx-hal/pull/237
5051

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ rand_core = "0.5.1"
3333
stm32f4 = "0.11"
3434
synopsys-usb-otg = { version = "0.2.0", features = ["cortex-m"], optional = true }
3535
sdio-host = { version = "0.5.0", optional = true }
36-
embedded-dma = "0.1.0"
36+
embedded-dma = "0.1.2"
3737

3838
[dependencies.bare-metal]
3939
version = "0.2.5"

src/dma/mod.rs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,8 +1007,9 @@ where
10071007
}
10081008

10091009
/// Changes the buffer and restarts or continues a double buffer transfer. This must be called
1010-
/// immediately after a transfer complete event. Returns the old buffer together with its
1011-
/// `CurrentBuffer`. If an error occurs, this method will return the new buffer with the error.
1010+
/// immediately after a transfer complete event if using double buffering, otherwise you might
1011+
/// lose data. Returns the old buffer together with its `CurrentBuffer`. If an error occurs,
1012+
/// this method will return the new buffer with the error.
10121013
///
10131014
/// This method will clear the transfer complete flag on entry, it will also clear it again if
10141015
/// an overrun occurs during its execution. Moreover, if an overrun occurs, the stream will be
@@ -1157,15 +1158,15 @@ where
11571158
}
11581159

11591160
/// Changes the buffer and restarts or continues a double buffer transfer. This must be called
1160-
/// immediately after a transfer complete event. The closure must return `(BUF, T)` where `BUF`
1161-
/// is the new buffer to be used. This method can be called before the end of an ongoing
1162-
/// transfer only if not using double buffering, in that case, the current transfer will be
1163-
/// canceled and a new one will be started. A `NotReady` error will be returned if this method
1164-
/// is called before the end of a transfer while double buffering and the closure won't be
1165-
/// executed.
1161+
/// immediately after a transfer complete event if using double buffering, otherwise you might
1162+
/// lose data. The closure must return `(BUF, T)` where `BUF` is the new buffer to be used. This
1163+
/// method can be called before the end of an ongoing transfer only if not using double
1164+
/// buffering, in that case, the current transfer will be canceled and a new one will be
1165+
/// started. A `NotReady` error will be returned if this method is called before the end of a
1166+
/// transfer while double buffering and the closure won't be executed.
11661167
///
11671168
/// # Panics
1168-
/// This method will panic when double buffering and one or both of the following conditions
1169+
/// This method will panic when double buffering if one or both of the following conditions
11691170
/// happen:
11701171
///
11711172
/// * The new buffer's length is smaller than the one used in the `init` method.
@@ -1175,10 +1176,6 @@ where
11751176
///
11761177
/// Memory corruption might occur in the previous buffer, the one passed to the closure, if an
11771178
/// overrun occurs in double buffering mode.
1178-
///
1179-
/// # Panics
1180-
///
1181-
/// This method will panic if an overrun is detected while double buffering.
11821179
pub unsafe fn next_transfer_with<F, T>(&mut self, f: F) -> Result<T, DMAError<()>>
11831180
where
11841181
F: FnOnce(BUF, CurrentBuffer) -> (BUF, T),

0 commit comments

Comments
 (0)