Protect DMA-related things with cfg.

This commit is contained in:
Bob McWhirter
2021-06-29 13:00:52 -04:00
parent 2a25de3d3e
commit 07a6686879
2 changed files with 8 additions and 7 deletions

View File

@ -26,6 +26,8 @@ pub enum Error {
pub(crate) mod sealed {
use super::*;
#[cfg(dma)]
use crate::dma::WriteDma;
pub trait Instance {
@ -47,8 +49,10 @@ pub(crate) mod sealed {
fn af_num(&self) -> u8;
}
#[cfg(dma)]
pub trait RxDma<T: Instance> {}
#[cfg(dma)]
pub trait TxDma<T: Instance>: WriteDma<T> {}
}
@ -59,7 +63,9 @@ pub trait CtsPin<T: Instance>: sealed::CtsPin<T> {}
pub trait RtsPin<T: Instance>: sealed::RtsPin<T> {}
pub trait CkPin<T: Instance>: sealed::CkPin<T> {}
#[cfg(dma)]
pub trait RxDma<T: Instance>: sealed::RxDma<T> {}
#[cfg(dma)]
pub trait TxDma<T: Instance>: sealed::TxDma<T> {}
crate::pac::peripherals!(