mirror of
https://github.com/esp-rs/esp-hal.git
synced 2025-09-30 05:40:39 +00:00
Add repr(C) to DmaDescriptor, allow unstably constructing dma::Channel
(#2988)
* Add repr(C) to DmaDescriptor * Allow creating DMA channel drivers
This commit is contained in:
parent
81382bafc7
commit
3fac1979d0
@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
### Fixed
|
||||
|
||||
- `DmaDescriptor` is now `#[repr(C)]` (#2988)
|
||||
|
||||
### Removed
|
||||
|
||||
## [0.23.1] - 2025-01-15
|
||||
|
@ -274,6 +274,7 @@ impl defmt::Format for DmaDescriptorFlags {
|
||||
/// A DMA transfer descriptor.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
||||
#[repr(C)]
|
||||
pub struct DmaDescriptor {
|
||||
/// Descriptor flags.
|
||||
pub flags: DmaDescriptorFlags,
|
||||
@ -2463,7 +2464,9 @@ impl<'d, CH> Channel<'d, Blocking, CH>
|
||||
where
|
||||
CH: DmaChannel,
|
||||
{
|
||||
pub(crate) fn new(channel: impl Peripheral<P = CH>) -> Self {
|
||||
/// Creates a new DMA channel driver.
|
||||
#[instability::unstable]
|
||||
pub fn new(channel: impl Peripheral<P = CH>) -> Self {
|
||||
let (rx, tx) = unsafe {
|
||||
channel
|
||||
.clone_unchecked()
|
||||
|
Loading…
x
Reference in New Issue
Block a user