Run rustfmt.
This commit is contained in:
@ -3,16 +3,15 @@
|
||||
use core::sync::atomic::{fence, Ordering};
|
||||
use core::task::Waker;
|
||||
|
||||
use crate::interrupt::{Interrupt, InterruptExt};
|
||||
use embassy::waitqueue::AtomicWaker;
|
||||
|
||||
use super::{TransferOptions, Word, WordSize};
|
||||
use crate::_generated::BDMA_CHANNEL_COUNT;
|
||||
use crate::dma::Request;
|
||||
use crate::interrupt::{Interrupt, InterruptExt};
|
||||
use crate::pac;
|
||||
use crate::pac::bdma::vals;
|
||||
|
||||
use super::{TransferOptions, Word, WordSize};
|
||||
|
||||
impl From<WordSize> for vals::Size {
|
||||
fn from(raw: WordSize) -> Self {
|
||||
match raw {
|
||||
@ -185,14 +184,8 @@ mod low_level_api {
|
||||
#[cfg(dmamux)] dmamux_regs: pac::dmamux::Dmamux,
|
||||
#[cfg(dmamux)] dmamux_ch_num: u8,
|
||||
) {
|
||||
assert!(
|
||||
options.mburst == crate::dma::Burst::Single,
|
||||
"Burst mode not supported"
|
||||
);
|
||||
assert!(
|
||||
options.pburst == crate::dma::Burst::Single,
|
||||
"Burst mode not supported"
|
||||
);
|
||||
assert!(options.mburst == crate::dma::Burst::Single, "Burst mode not supported");
|
||||
assert!(options.pburst == crate::dma::Burst::Single, "Burst mode not supported");
|
||||
assert!(
|
||||
options.flow_ctrl == crate::dma::FlowControl::Dma,
|
||||
"Peripheral flow control not supported"
|
||||
@ -206,10 +199,7 @@ mod low_level_api {
|
||||
super::super::dmamux::configure_dmamux(dmamux_regs, dmamux_ch_num, request);
|
||||
|
||||
#[cfg(bdma_v2)]
|
||||
critical_section::with(|_| {
|
||||
dma.cselr()
|
||||
.modify(|w| w.set_cs(channel_number as _, request))
|
||||
});
|
||||
critical_section::with(|_| dma.cselr().modify(|w| w.set_cs(channel_number as _, request)));
|
||||
|
||||
// "Preceding reads and writes cannot be moved past subsequent writes."
|
||||
fence(Ordering::SeqCst);
|
||||
@ -279,10 +269,7 @@ mod low_level_api {
|
||||
let cr = dma.ch(channel_num).cr();
|
||||
|
||||
if isr.teif(channel_num) {
|
||||
panic!(
|
||||
"DMA: error on BDMA@{:08x} channel {}",
|
||||
dma.0 as u32, channel_num
|
||||
);
|
||||
panic!("DMA: error on BDMA@{:08x} channel {}", dma.0 as u32, channel_num);
|
||||
}
|
||||
if isr.tcif(channel_num) && cr.read().tcie() {
|
||||
cr.write(|_| ()); // Disable channel interrupts with the default value.
|
||||
|
@ -1,15 +1,13 @@
|
||||
use core::sync::atomic::{fence, Ordering};
|
||||
use core::task::Waker;
|
||||
|
||||
use crate::interrupt::{Interrupt, InterruptExt};
|
||||
use embassy::waitqueue::AtomicWaker;
|
||||
|
||||
use crate::_generated::DMA_CHANNEL_COUNT;
|
||||
use crate::interrupt;
|
||||
use crate::pac;
|
||||
use crate::pac::dma::{regs, vals};
|
||||
|
||||
use super::{Burst, FlowControl, Request, TransferOptions, Word, WordSize};
|
||||
use crate::_generated::DMA_CHANNEL_COUNT;
|
||||
use crate::interrupt::{Interrupt, InterruptExt};
|
||||
use crate::pac::dma::{regs, vals};
|
||||
use crate::{interrupt, pac};
|
||||
|
||||
impl From<WordSize> for vals::Size {
|
||||
fn from(raw: WordSize) -> Self {
|
||||
@ -407,10 +405,7 @@ mod low_level_api {
|
||||
let isr = dma.isr(channel_num / 4).read();
|
||||
|
||||
if isr.teif(channel_num % 4) {
|
||||
panic!(
|
||||
"DMA: error on DMA@{:08x} channel {}",
|
||||
dma.0 as u32, channel_num
|
||||
);
|
||||
panic!("DMA: error on DMA@{:08x} channel {}", dma.0 as u32, channel_num);
|
||||
}
|
||||
|
||||
if isr.tcif(channel_num % 4) && cr.read().tcie() {
|
||||
@ -418,8 +413,7 @@ mod low_level_api {
|
||||
cr.write(|_| ()); // Disable channel with the default value.
|
||||
} else {
|
||||
// for double buffered mode, clear TCIF flag but do not stop the transfer
|
||||
dma.ifcr(channel_num / 4)
|
||||
.write(|w| w.set_tcif(channel_num % 4, true));
|
||||
dma.ifcr(channel_num / 4).write(|w| w.set_tcif(channel_num % 4, true));
|
||||
}
|
||||
STATE.channels[state_index].waker.wake();
|
||||
}
|
||||
|
@ -1,13 +1,8 @@
|
||||
#![macro_use]
|
||||
|
||||
use crate::pac;
|
||||
use crate::peripherals;
|
||||
use crate::{pac, peripherals};
|
||||
|
||||
pub(crate) unsafe fn configure_dmamux(
|
||||
dmamux_regs: pac::dmamux::Dmamux,
|
||||
dmamux_ch_num: u8,
|
||||
request: u8,
|
||||
) {
|
||||
pub(crate) unsafe fn configure_dmamux(dmamux_regs: pac::dmamux::Dmamux, dmamux_ch_num: u8, request: u8) {
|
||||
let ch_mux_regs = dmamux_regs.ccr(dmamux_ch_num as _);
|
||||
ch_mux_regs.write(|reg| {
|
||||
reg.set_nbreq(0);
|
||||
|
@ -1,15 +1,13 @@
|
||||
use core::sync::atomic::{fence, Ordering};
|
||||
use core::task::Waker;
|
||||
|
||||
use crate::interrupt::{Interrupt, InterruptExt};
|
||||
use embassy::waitqueue::AtomicWaker;
|
||||
|
||||
use crate::_generated::GPDMA_CHANNEL_COUNT;
|
||||
use crate::interrupt;
|
||||
use crate::pac;
|
||||
use crate::pac::gpdma::{vals, Gpdma};
|
||||
|
||||
use super::{Request, TransferOptions, Word, WordSize};
|
||||
use crate::_generated::GPDMA_CHANNEL_COUNT;
|
||||
use crate::interrupt::{Interrupt, InterruptExt};
|
||||
use crate::pac::gpdma::{vals, Gpdma};
|
||||
use crate::{interrupt, pac};
|
||||
|
||||
impl From<WordSize> for vals::ChTr1Dw {
|
||||
fn from(raw: WordSize) -> Self {
|
||||
|
@ -7,18 +7,18 @@ mod dmamux;
|
||||
#[cfg(gpdma)]
|
||||
mod gpdma;
|
||||
|
||||
#[cfg(dmamux)]
|
||||
pub use dmamux::*;
|
||||
|
||||
use crate::Unborrow;
|
||||
use core::future::Future;
|
||||
use core::marker::PhantomData;
|
||||
use core::mem;
|
||||
use core::pin::Pin;
|
||||
use core::task::Waker;
|
||||
use core::task::{Context, Poll};
|
||||
use core::task::{Context, Poll, Waker};
|
||||
|
||||
#[cfg(dmamux)]
|
||||
pub use dmamux::*;
|
||||
use embassy_hal_common::unborrow;
|
||||
|
||||
use crate::Unborrow;
|
||||
|
||||
#[cfg(feature = "unstable-pac")]
|
||||
pub mod low_level {
|
||||
pub use super::transfers::*;
|
||||
@ -249,15 +249,7 @@ mod transfers {
|
||||
) -> impl Future<Output = ()> + 'a {
|
||||
unborrow!(channel);
|
||||
|
||||
unsafe {
|
||||
channel.start_write_repeated::<W>(
|
||||
request,
|
||||
repeated,
|
||||
count,
|
||||
reg_addr,
|
||||
Default::default(),
|
||||
)
|
||||
};
|
||||
unsafe { channel.start_write_repeated::<W>(request, repeated, count, reg_addr, Default::default()) };
|
||||
|
||||
Transfer::new(channel)
|
||||
}
|
||||
|
Reference in New Issue
Block a user