diff options
| author | Christian Perez Llamas <[email protected]> | 2022-11-19 01:38:03 +0100 |
|---|---|---|
| committer | Christian Perez Llamas <[email protected]> | 2022-11-19 01:38:03 +0100 |
| commit | 64e8cfef8e53293b35d2c5ea2b822bdc3a12111e (patch) | |
| tree | 6814d1241649efff8d2026d04b3858f186399703 /embassy-nrf/src/i2s.rs | |
| parent | 16838f8a66d8a3b74f0fe1ab9124532226e7166a (diff) | |
Fix build
Diffstat (limited to 'embassy-nrf/src/i2s.rs')
| -rw-r--r-- | embassy-nrf/src/i2s.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/embassy-nrf/src/i2s.rs b/embassy-nrf/src/i2s.rs index 53d9f9a1b..52b72df27 100644 --- a/embassy-nrf/src/i2s.rs +++ b/embassy-nrf/src/i2s.rs | |||
| @@ -14,13 +14,10 @@ use embassy_hal_common::{into_ref, PeripheralRef}; | |||
| 14 | use crate::gpio::{AnyPin, Pin as GpioPin}; | 14 | use crate::gpio::{AnyPin, Pin as GpioPin}; |
| 15 | use crate::interrupt::Interrupt; | 15 | use crate::interrupt::Interrupt; |
| 16 | use crate::pac::i2s::RegisterBlock; | 16 | use crate::pac::i2s::RegisterBlock; |
| 17 | use crate::Peripheral; | 17 | use crate::{EASY_DMA_SIZE, Peripheral}; |
| 18 | 18 | ||
| 19 | // TODO: Define those in lib.rs somewhere else | 19 | // TODO: Define those in lib.rs somewhere else |
| 20 | 20 | ||
| 21 | /// I2S EasyDMA MAXCNT bit length = 14 | ||
| 22 | const MAX_DMA_MAXCNT: u32 = 1 << 14; | ||
| 23 | |||
| 24 | /// Limits for Easy DMA - it can only read from data ram | 21 | /// Limits for Easy DMA - it can only read from data ram |
| 25 | pub const SRAM_LOWER: usize = 0x2000_0000; | 22 | pub const SRAM_LOWER: usize = 0x2000_0000; |
| 26 | pub const SRAM_UPPER: usize = 0x3000_0000; | 23 | pub const SRAM_UPPER: usize = 0x3000_0000; |
| @@ -956,7 +953,7 @@ impl<T: Instance> Device<T> { | |||
| 956 | Err(Error::BufferLengthMisaligned) | 953 | Err(Error::BufferLengthMisaligned) |
| 957 | } else if (ptr as usize) < SRAM_LOWER || (ptr as usize) > SRAM_UPPER { | 954 | } else if (ptr as usize) < SRAM_LOWER || (ptr as usize) > SRAM_UPPER { |
| 958 | Err(Error::BufferNotInDataMemory) | 955 | Err(Error::BufferNotInDataMemory) |
| 959 | } else if maxcnt > MAX_DMA_MAXCNT { | 956 | } else if maxcnt as usize > EASY_DMA_SIZE { |
| 960 | Err(Error::BufferTooLong) | 957 | Err(Error::BufferTooLong) |
| 961 | } else { | 958 | } else { |
| 962 | Ok((ptr, maxcnt)) | 959 | Ok((ptr, maxcnt)) |
