Skip to content

Commit 6b60fcc

Browse files
sprhawkteskje
authored andcommitted
enable dma in serial for stm32f302xx
1 parent 5b6ba4e commit 6b60fcc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/serial.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ use crate::gpio::gpiod;
3737
))]
3838
use crate::gpio::gpioe;
3939

40-
#[cfg(feature = "stm32f303")]
40+
#[cfg(any(feature = "stm32f303", feature = "stm32f302"))]
4141
use crate::dma;
42-
#[cfg(feature = "stm32f303")]
42+
#[cfg(any(feature = "stm32f303", feature = "stm32f302"))]
4343
use cortex_m::interrupt;
4444

4545
/// Interrupt event
@@ -363,7 +363,7 @@ macro_rules! hal {
363363

364364
impl blocking::serial::write::Default<u8> for Tx<$USARTX> {}
365365

366-
#[cfg(feature = "stm32f303")]
366+
#[cfg(any(feature = "stm32f303", feature = "stm32f302"))]
367367
impl Rx<$USARTX> {
368368
/// Fill the buffer with received data using DMA.
369369
pub fn read_exact<B, C>(
@@ -384,7 +384,7 @@ macro_rules! hal {
384384
}
385385
}
386386

387-
#[cfg(feature = "stm32f303")]
387+
#[cfg(any(feature = "stm32f303", feature = "stm32f302"))]
388388
impl Tx<$USARTX> {
389389
/// Transmit all data in the buffer using DMA.
390390
pub fn write_all<B, C>(
@@ -405,7 +405,7 @@ macro_rules! hal {
405405
}
406406
}
407407

408-
#[cfg(feature = "stm32f303")]
408+
#[cfg(any(feature = "stm32f303", feature = "stm32f302"))]
409409
impl dma::Target for Rx<$USARTX> {
410410
fn enable_dma(&mut self) {
411411
// NOTE(unsafe) critical section prevents races
@@ -424,7 +424,7 @@ macro_rules! hal {
424424
}
425425
}
426426

427-
#[cfg(feature = "stm32f303")]
427+
#[cfg(any(feature = "stm32f303", feature = "stm32f302"))]
428428
impl dma::Target for Tx<$USARTX> {
429429
fn enable_dma(&mut self) {
430430
// NOTE(unsafe) critical section prevents races

0 commit comments

Comments
 (0)