@@ -37,9 +37,9 @@ use crate::gpio::gpiod;
37
37
) ) ]
38
38
use crate :: gpio:: gpioe;
39
39
40
- #[ cfg( feature = "stm32f303" ) ]
40
+ #[ cfg( any ( feature = "stm32f303" , feature = "stm32f302" ) ) ]
41
41
use crate :: dma;
42
- #[ cfg( feature = "stm32f303" ) ]
42
+ #[ cfg( any ( feature = "stm32f303" , feature = "stm32f302" ) ) ]
43
43
use cortex_m:: interrupt;
44
44
45
45
/// Interrupt event
@@ -363,7 +363,7 @@ macro_rules! hal {
363
363
364
364
impl blocking:: serial:: write:: Default <u8 > for Tx <$USARTX> { }
365
365
366
- #[ cfg( feature = "stm32f303" ) ]
366
+ #[ cfg( any ( feature = "stm32f303" , feature = "stm32f302" ) ) ]
367
367
impl Rx <$USARTX> {
368
368
/// Fill the buffer with received data using DMA.
369
369
pub fn read_exact<B , C >(
@@ -384,7 +384,7 @@ macro_rules! hal {
384
384
}
385
385
}
386
386
387
- #[ cfg( feature = "stm32f303" ) ]
387
+ #[ cfg( any ( feature = "stm32f303" , feature = "stm32f302" ) ) ]
388
388
impl Tx <$USARTX> {
389
389
/// Transmit all data in the buffer using DMA.
390
390
pub fn write_all<B , C >(
@@ -405,7 +405,7 @@ macro_rules! hal {
405
405
}
406
406
}
407
407
408
- #[ cfg( feature = "stm32f303" ) ]
408
+ #[ cfg( any ( feature = "stm32f303" , feature = "stm32f302" ) ) ]
409
409
impl dma:: Target for Rx <$USARTX> {
410
410
fn enable_dma( & mut self ) {
411
411
// NOTE(unsafe) critical section prevents races
@@ -424,7 +424,7 @@ macro_rules! hal {
424
424
}
425
425
}
426
426
427
- #[ cfg( feature = "stm32f303" ) ]
427
+ #[ cfg( any ( feature = "stm32f303" , feature = "stm32f302" ) ) ]
428
428
impl dma:: Target for Tx <$USARTX> {
429
429
fn enable_dma( & mut self ) {
430
430
// NOTE(unsafe) critical section prevents races
0 commit comments