Skip to content

Commit 578921a

Browse files
bors[bot]burrbull
andauthored
Merge #341
341: Dma cleanups r=thalesfragoso a=burrbull Co-authored-by: Andrey Zgarbul <zgarbul.andrey@gmail.com>
2 parents 657b265 + df75a34 commit 578921a

File tree

6 files changed

+641
-870
lines changed

6 files changed

+641
-870
lines changed

CHANGELOG.md

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

4545
### Changed
4646

47+
- Split `Stream` trait on `Stream` and `StreamISR`.
48+
Use const generics for `Stream` and `Channel`.
4749
- [breaking-change] `Timer::new` now just initializes peripheral.
4850
Use `.start_count_down` to start count, `pwm` or `delay` on `Timer` struct.
4951
- Add `Spi::new`, `I2s::new, `spi::Instance` and deprecate `Spi:spix`,

examples/adc_dma_rtic.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use stm32f4xx_hal::{
1111
config::{AdcConfig, Dma, SampleTime, Scan, Sequence},
1212
Adc, Temperature,
1313
},
14-
dma::{config::DmaConfig, Channel0, PeripheralToMemory, Stream0, StreamsTuple, Transfer},
14+
dma::{config::DmaConfig, PeripheralToMemory, Stream0, StreamsTuple, Transfer},
1515
prelude::*,
1616
signature::{VtempCal110, VtempCal30},
1717
stm32,
@@ -20,8 +20,7 @@ use stm32f4xx_hal::{
2020

2121
const POLLING_PERIOD: u32 = 168_000_000 / 2;
2222

23-
type DMATransfer =
24-
Transfer<Stream0<DMA2>, Channel0, Adc<ADC1>, PeripheralToMemory, &'static mut [u16; 2]>;
23+
type DMATransfer = Transfer<Stream0<DMA2>, Adc<ADC1>, PeripheralToMemory, &'static mut [u16; 2], 0>;
2524

2625
#[rtic::app(device = stm32f4xx_hal::stm32, peripherals = true, monotonic = rtic::cyccnt::CYCCNT)]
2726
const APP: () = {

examples/i2s-audio-out-dma.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ use stm32_i2s_v12x::{MasterClock, MasterConfig, Polarity, TransmitMode};
5151
use stm32f4xx_hal::delay::Delay;
5252
use stm32f4xx_hal::dma::config::DmaConfig;
5353
use stm32f4xx_hal::dma::MemoryToPeripheral;
54-
use stm32f4xx_hal::dma::{Channel0, Stream5, StreamsTuple, Transfer};
54+
use stm32f4xx_hal::dma::{Stream5, StreamsTuple, Transfer};
5555
use stm32f4xx_hal::gpio::gpioa::PA4;
5656
use stm32f4xx_hal::gpio::gpioc::{PC10, PC12, PC7};
5757
use stm32f4xx_hal::gpio::Alternate;
@@ -212,7 +212,6 @@ fn main() -> ! {
212212

213213
type I2sDmaTransfer = Transfer<
214214
Stream5<DMA1>,
215-
Channel0,
216215
stm32_i2s_v12x::I2s<
217216
I2s<
218217
SPI3,
@@ -227,6 +226,7 @@ type I2sDmaTransfer = Transfer<
227226
>,
228227
MemoryToPeripheral,
229228
&'static mut [u16; SINE_SAMPLES * 2],
229+
0,
230230
>;
231231

232232
/// DMA transfer handoff from main() to interrupt handler

0 commit comments

Comments
 (0)