Skip to content

Commit 77a6700

Browse files
bors[bot]burrbull
andauthored
Merge #440
440: update embedded-dma r=therealprof a=burrbull No more `generic-array` in dependency tree!!! Co-authored-by: Andrey Zgarbul <[email protected]>
2 parents 05c875b + aaa5ed4 commit 77a6700

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
99

1010
### Changed
1111

12+
- Use `embedded-dma` v0.2 [#440]
1213
- Add LSI support for `Rtc` [#438]
1314
- Use `time` for `Rtc` instead of `rtcc`, add `rtc` example [#436]
1415
- Move `i2c` `embedded-hal` trait impls to `I2c` methods [#431]
@@ -44,6 +45,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
4445
[#434]: https://github.com/stm32-rs/stm32f4xx-hal/pull/434
4546
[#436]: https://github.com/stm32-rs/stm32f4xx-hal/pull/436
4647
[#438]: https://github.com/stm32-rs/stm32f4xx-hal/pull/438
48+
[#440]: https://github.com/stm32-rs/stm32f4xx-hal/pull/440
4749

4850
### Changed
4951

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ rand_core = "0.6"
3535
stm32f4 = "0.14.0"
3636
synopsys-usb-otg = { version = "0.2.0", features = ["cortex-m"], optional = true }
3737
sdio-host = { version = "0.5.0", optional = true }
38-
embedded-dma = "0.1.2"
38+
embedded-dma = "0.2.0"
3939
bare-metal = { version = "1" }
4040
cast = { default-features = false, version = "0.3.0" }
4141
void = { default-features = false, version = "1.0.2" }

src/dma/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use core::{
1515
ptr,
1616
sync::atomic::{compiler_fence, Ordering},
1717
};
18-
use embedded_dma::{StaticReadBuffer, StaticWriteBuffer};
18+
use embedded_dma::{ReadBuffer, WriteBuffer};
1919

2020
use crate::pac::RCC;
2121
use crate::{pac, rcc};
@@ -889,7 +889,7 @@ where
889889
STREAM: Stream,
890890
ChannelX<CHANNEL>: Channel,
891891
PERIPHERAL: PeriAddress + DMASet<STREAM, MemoryToPeripheral, CHANNEL>,
892-
BUF: StaticReadBuffer<Word = <PERIPHERAL as PeriAddress>::MemSize>,
892+
BUF: ReadBuffer<Word = <PERIPHERAL as PeriAddress>::MemSize>,
893893
{
894894
/// Configures the DMA stream to the correct channel for the peripheral, configures source and
895895
/// destination and applies supplied configuration. If double buffering is enabled, the
@@ -1020,7 +1020,7 @@ where
10201020
STREAM: Stream,
10211021
ChannelX<CHANNEL>: Channel,
10221022
PERIPHERAL: PeriAddress + DMASet<STREAM, PeripheralToMemory, CHANNEL> + SafePeripheralRead,
1023-
BUF: StaticWriteBuffer<Word = <PERIPHERAL as PeriAddress>::MemSize>,
1023+
BUF: WriteBuffer<Word = <PERIPHERAL as PeriAddress>::MemSize>,
10241024
{
10251025
/// Access the owned peripheral for reading
10261026
pub fn peripheral(&self) -> &PERIPHERAL {
@@ -1034,7 +1034,7 @@ where
10341034
STREAM: Stream,
10351035
ChannelX<CHANNEL>: Channel,
10361036
PERIPHERAL: PeriAddress + DMASet<STREAM, PeripheralToMemory, CHANNEL>,
1037-
BUF: StaticWriteBuffer<Word = <PERIPHERAL as PeriAddress>::MemSize>,
1037+
BUF: WriteBuffer<Word = <PERIPHERAL as PeriAddress>::MemSize>,
10381038
{
10391039
/// Configures the DMA stream to the correct channel for the peripheral, configures source and
10401040
/// destination and applies supplied configuration. If double buffering is enabled, the
@@ -1169,7 +1169,7 @@ where
11691169
ChannelX<CHANNEL>: Channel,
11701170
PERIPHERAL: PeriAddress + DMASet<STREAM, MemoryToMemory<S>, CHANNEL>,
11711171
MemoryToMemory<S>: PeriAddress,
1172-
BUF: StaticWriteBuffer<Word = <PERIPHERAL as PeriAddress>::MemSize>,
1172+
BUF: WriteBuffer<Word = <PERIPHERAL as PeriAddress>::MemSize>,
11731173
{
11741174
/// Configures the DMA stream to the correct channel for the peripheral, configures source and
11751175
/// destination and applies supplied configuration. In a memory to memory transfer,

src/rtc.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,11 @@ impl Rtc<Lsi> {
187187
}
188188

189189
fn enable_lsi(&mut self, rcc: &RegisterBlock) {
190-
unsafe {
191-
// Force a reset of the backup domain.
192-
self.backup_reset(rcc);
193-
// Enable the LSI.
194-
rcc.csr.modify(|_, w| w.lsion().on());
195-
while rcc.csr.read().lsirdy().is_not_ready() {}
196-
}
190+
// Force a reset of the backup domain.
191+
self.backup_reset(rcc);
192+
// Enable the LSI.
193+
rcc.csr.modify(|_, w| w.lsion().on());
194+
while rcc.csr.read().lsirdy().is_not_ready() {}
197195
}
198196
}
199197

0 commit comments

Comments
 (0)