Correct DMA descriptor docs, math (#622)
This commit is contained in:
parent
3c4dc8df6a
commit
7f80b23c9d
@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
- Corrected the expected DMA descriptor counts (#622)
|
||||||
- DMA is supported for SPI3 on ESP32-S3 (#507)
|
- DMA is supported for SPI3 on ESP32-S3 (#507)
|
||||||
- `change_bus_frequency` is now available on `SpiDma` (#529)
|
- `change_bus_frequency` is now available on `SpiDma` (#529)
|
||||||
- Fixed a bug where a GPIO interrupt could erroneously fire again causing the next `await` on that pin to instantly return `Poll::Ok` (#537)
|
- Fixed a bug where a GPIO interrupt could erroneously fire again causing the next `await` on that pin to instantly return `Poll::Ok` (#537)
|
||||||
|
|||||||
@ -390,7 +390,8 @@ macro_rules! impl_channel {
|
|||||||
impl [<ChannelCreator $num>] {
|
impl [<ChannelCreator $num>] {
|
||||||
/// Configure the channel for use
|
/// Configure the channel for use
|
||||||
///
|
///
|
||||||
/// Descriptors should be sized as (BUFFERSIZE / 4092) * 3
|
/// Descriptors should be sized as `((BUFFERSIZE + 4091) / 4092) * 3`. I.e., to
|
||||||
|
/// transfer buffers of size `1..=4092`, you need 3 descriptors.
|
||||||
pub fn configure<'a>(
|
pub fn configure<'a>(
|
||||||
self,
|
self,
|
||||||
burst_mode: bool,
|
burst_mode: bool,
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
//! Direct Memory Access Commons
|
//! Direct Memory Access Commons
|
||||||
//!
|
//!
|
||||||
//! Descriptors should be sized as (BUFFERSIZE / 4092) * 3
|
//! Descriptors should be sized as `((BUFFERSIZE + 4091) / 4092) * 3`. I.e., to
|
||||||
|
//! transfer buffers of size `1..=4092`, you need 3 descriptors.
|
||||||
|
|
||||||
use core::{marker::PhantomData, sync::atomic::compiler_fence};
|
use core::{marker::PhantomData, sync::atomic::compiler_fence};
|
||||||
|
|
||||||
@ -347,7 +348,7 @@ where
|
|||||||
return Err(DmaError::InvalidDescriptorSize);
|
return Err(DmaError::InvalidDescriptorSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.descriptors.len() / 3 < len / CHUNK_SIZE {
|
if self.descriptors.len() / 3 < (len + CHUNK_SIZE - 1) / CHUNK_SIZE {
|
||||||
return Err(DmaError::OutOfDescriptors);
|
return Err(DmaError::OutOfDescriptors);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -647,7 +648,7 @@ where
|
|||||||
return Err(DmaError::InvalidDescriptorSize);
|
return Err(DmaError::InvalidDescriptorSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.descriptors.len() / 3 < len / CHUNK_SIZE {
|
if self.descriptors.len() / 3 < (len + CHUNK_SIZE - 1) / CHUNK_SIZE {
|
||||||
return Err(DmaError::OutOfDescriptors);
|
return Err(DmaError::OutOfDescriptors);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user