Standardize module structure, fix some build failures
This commit is contained in:
@ -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;
|
||||
|
@ -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(())
|
0
embassy-stm32/src/usart/v2.rs
Normal file
0
embassy-stm32/src/usart/v2.rs
Normal file
Reference in New Issue
Block a user