diff options
Diffstat (limited to 'embassy-rp/src/dma.rs')
| -rw-r--r-- | embassy-rp/src/dma.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/embassy-rp/src/dma.rs b/embassy-rp/src/dma.rs index 1cbb4651a..25819f03e 100644 --- a/embassy-rp/src/dma.rs +++ b/embassy-rp/src/dma.rs | |||
| @@ -4,14 +4,15 @@ use core::pin::Pin; | |||
| 4 | use core::sync::atomic::{compiler_fence, Ordering}; | 4 | use core::sync::atomic::{compiler_fence, Ordering}; |
| 5 | use core::task::{Context, Poll}; | 5 | use core::task::{Context, Poll}; |
| 6 | 6 | ||
| 7 | use embassy_cortex_m::interrupt::Interrupt; | ||
| 8 | use embassy_hal_common::{impl_peripheral, into_ref, Peripheral, PeripheralRef}; | 7 | use embassy_hal_common::{impl_peripheral, into_ref, Peripheral, PeripheralRef}; |
| 9 | use embassy_sync::waitqueue::AtomicWaker; | 8 | use embassy_sync::waitqueue::AtomicWaker; |
| 10 | use pac::dma::vals::DataSize; | 9 | use pac::dma::vals::DataSize; |
| 11 | 10 | ||
| 11 | use crate::interrupt::InterruptExt; | ||
| 12 | use crate::pac::dma::vals; | 12 | use crate::pac::dma::vals; |
| 13 | use crate::{interrupt, pac, peripherals}; | 13 | use crate::{interrupt, pac, peripherals}; |
| 14 | 14 | ||
| 15 | #[cfg(feature = "rt")] | ||
| 15 | #[interrupt] | 16 | #[interrupt] |
| 16 | unsafe fn DMA_IRQ_0() { | 17 | unsafe fn DMA_IRQ_0() { |
| 17 | let ints0 = pac::DMA.ints0().read().ints0(); | 18 | let ints0 = pac::DMA.ints0().read().ints0(); |
| @@ -29,12 +30,12 @@ unsafe fn DMA_IRQ_0() { | |||
| 29 | } | 30 | } |
| 30 | 31 | ||
| 31 | pub(crate) unsafe fn init() { | 32 | pub(crate) unsafe fn init() { |
| 32 | interrupt::DMA_IRQ_0::disable(); | 33 | interrupt::DMA_IRQ_0.disable(); |
| 33 | interrupt::DMA_IRQ_0::set_priority(interrupt::Priority::P3); | 34 | interrupt::DMA_IRQ_0.set_priority(interrupt::Priority::P3); |
| 34 | 35 | ||
| 35 | pac::DMA.inte0().write(|w| w.set_inte0(0xFFFF)); | 36 | pac::DMA.inte0().write(|w| w.set_inte0(0xFFFF)); |
| 36 | 37 | ||
| 37 | interrupt::DMA_IRQ_0::enable(); | 38 | interrupt::DMA_IRQ_0.enable(); |
| 38 | } | 39 | } |
| 39 | 40 | ||
| 40 | pub unsafe fn read<'a, C: Channel, W: Word>( | 41 | pub unsafe fn read<'a, C: Channel, W: Word>( |
