Standardize module structure, fix some build failures

This commit is contained in:
Dario Nieuwenhuis
2021-05-17 02:04:51 +02:00
parent bdc3ada4b2
commit 2303364322
269 changed files with 8528 additions and 185154 deletions

View File

@ -1,10 +1,9 @@
#![macro_use]
#[cfg_attr(feature = "_usart_v1", path = "usart_v1.rs")]
#[cfg_attr(feature = "_usart_v2", path = "usart_v2.rs")]
mod usart;
pub use usart::*;
#[cfg_attr(feature = "_usart_v1", path = "v1.rs")]
#[cfg_attr(feature = "_usart_v2", path = "v2.rs")]
mod _version;
pub use _version::*;
use crate::gpio::Pin;
use crate::pac::usart::Usart;

View File

@ -3,7 +3,6 @@ use core::marker::PhantomData;
use embassy::util::Unborrow;
use embassy_extras::unborrow;
use crate::dma::{transfer_m2p, Channel};
use crate::gpio::{NoPin, Pin};
use crate::pac::usart::{regs, vals, Usart};
@ -103,7 +102,8 @@ impl<'d, T: Instance> Uart<'d, T> {
}
}
pub async fn write_dma(&mut self, ch: &mut impl Channel, buffer: &[u8]) -> Result<(), Error> {
#[cfg(feature = "_dma_v2")]
pub async fn write_dma(&mut self, ch: &mut impl crate::dma::Channel, buffer: &[u8]) -> Result<(), Error> {
let ch_func = 4; // USART3_TX
let r = self.inner.regs();
@ -114,7 +114,7 @@ impl<'d, T: Instance> Uart<'d, T> {
let dst = r.dr().ptr() as *mut u8;
transfer_m2p(ch, ch_func, buffer, dst).await;
crate::dma::transfer_m2p(ch, ch_func, buffer, dst).await;
}
Ok(())

View File