Skip to content

Commit 574d47a

Browse files
committed
Add Sealed to serial::uart_impls::RegisterBlockImpl
1 parent 7e90edf commit 574d47a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/serial/uart_impls.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ use crate::rcc::{self, Clocks};
1616
pub(crate) use crate::pac::uart4::RegisterBlock as RegisterBlockUart;
1717
pub(crate) use crate::pac::usart1::RegisterBlock as RegisterBlockUsart;
1818

19+
#[cfg(feature = "uart4")]
20+
impl crate::Sealed for RegisterBlockUart {}
21+
impl crate::Sealed for RegisterBlockUsart {}
22+
1923
// Implemented by all USART/UART instances
2024
pub trait Instance: crate::Sealed + rcc::Enable + rcc::Reset + rcc::BusClock + CommonPins {
2125
type RegisterBlock;
@@ -26,7 +30,7 @@ pub trait Instance: crate::Sealed + rcc::Enable + rcc::Reset + rcc::BusClock + C
2630
fn set_stopbits(&self, bits: config::StopBits);
2731
}
2832

29-
pub trait RegisterBlockImpl {
33+
pub trait RegisterBlockImpl: crate::Sealed {
3034
fn new<UART: Instance<RegisterBlock = Self>, WORD>(
3135
uart: UART,
3236
pins: (impl Into<UART::Tx<PushPull>>, impl Into<UART::Rx<PushPull>>),

0 commit comments

Comments
 (0)