@@ -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 = "stm32f302" , feature = " stm32f303") ) ]
41
41
use crate :: dma;
42
- #[ cfg( feature = "stm32f303" ) ]
42
+ #[ cfg( any ( feature = "stm32f302" , feature = " stm32f303") ) ]
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 = "stm32f302" , feature = " stm32f303") ) ]
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 = "stm32f302" , feature = " stm32f303") ) ]
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 = "stm32f302" , feature = " stm32f303") ) ]
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 = "stm32f302" , feature = " stm32f303") ) ]
428
428
impl dma:: Target for Tx <$USARTX> {
429
429
fn enable_dma( & mut self ) {
430
430
// NOTE(unsafe) critical section prevents races
@@ -446,24 +446,8 @@ macro_rules! hal {
446
446
}
447
447
}
448
448
449
- #[ cfg( any(
450
- feature = "stm32f301" ,
451
- feature = "stm32f318" ,
452
- feature = "stm32f303" ,
453
- feature = "stm32f373" ,
454
- feature = "stm32f378" ,
455
- feature = "stm32f328" ,
456
- feature = "stm32f358" ,
457
- feature = "stm32f398"
458
- ) ) ]
459
449
hal ! {
460
450
USART1 : ( usart1, APB2 , usart1en, usart1rst, pclk2) ,
461
451
USART2 : ( usart2, APB1 , usart2en, usart2rst, pclk1) ,
462
452
USART3 : ( usart3, APB1 , usart3en, usart3rst, pclk1) ,
463
453
}
464
-
465
- #[ cfg( any( feature = "stm32f302" , feature = "stm32f334" ) ) ]
466
- hal ! {
467
- USART1 : ( usart1, APB2 , usart1en, usart1rst, pclk2) ,
468
- USART2 : ( usart2, APB1 , usart2en, usart2rst, pclk1) ,
469
- }
0 commit comments