enable clock first
This commit is contained in:
@ -228,7 +228,7 @@ impl<'d, T: BasicInstance, TxDma> UartTx<'d, T, TxDma> {
|
||||
tx_dma: impl Peripheral<P = TxDma> + 'd,
|
||||
config: Config,
|
||||
) -> Result<Self, ConfigError> {
|
||||
T::reset_and_enable();
|
||||
T::enable_and_reset();
|
||||
|
||||
Self::new_inner(peri, tx, tx_dma, config)
|
||||
}
|
||||
@ -242,7 +242,7 @@ impl<'d, T: BasicInstance, TxDma> UartTx<'d, T, TxDma> {
|
||||
) -> Result<Self, ConfigError> {
|
||||
into_ref!(cts);
|
||||
|
||||
T::reset_and_enable();
|
||||
T::enable_and_reset();
|
||||
|
||||
cts.set_as_af(cts.af_num(), AFType::Input);
|
||||
T::regs().cr3().write(|w| {
|
||||
@ -319,7 +319,7 @@ impl<'d, T: BasicInstance, RxDma> UartRx<'d, T, RxDma> {
|
||||
rx_dma: impl Peripheral<P = RxDma> + 'd,
|
||||
config: Config,
|
||||
) -> Result<Self, ConfigError> {
|
||||
T::reset_and_enable();
|
||||
T::enable_and_reset();
|
||||
|
||||
Self::new_inner(peri, rx, rx_dma, config)
|
||||
}
|
||||
@ -334,7 +334,7 @@ impl<'d, T: BasicInstance, RxDma> UartRx<'d, T, RxDma> {
|
||||
) -> Result<Self, ConfigError> {
|
||||
into_ref!(rts);
|
||||
|
||||
T::reset_and_enable();
|
||||
T::enable_and_reset();
|
||||
|
||||
rts.set_as_af(rts.af_num(), AFType::OutputPushPull);
|
||||
T::regs().cr3().write(|w| {
|
||||
@ -691,8 +691,8 @@ impl<'d, T: BasicInstance, TxDma, RxDma> Uart<'d, T, TxDma, RxDma> {
|
||||
config: Config,
|
||||
) -> Result<Self, ConfigError> {
|
||||
// UartRx and UartTx have one refcount ea.
|
||||
T::reset_and_enable();
|
||||
T::reset_and_enable();
|
||||
T::enable_and_reset();
|
||||
T::enable_and_reset();
|
||||
|
||||
Self::new_inner(peri, rx, tx, tx_dma, rx_dma, config)
|
||||
}
|
||||
@ -711,8 +711,8 @@ impl<'d, T: BasicInstance, TxDma, RxDma> Uart<'d, T, TxDma, RxDma> {
|
||||
into_ref!(cts, rts);
|
||||
|
||||
// UartRx and UartTx have one refcount ea.
|
||||
T::reset_and_enable();
|
||||
T::reset_and_enable();
|
||||
T::enable_and_reset();
|
||||
T::enable_and_reset();
|
||||
|
||||
rts.set_as_af(rts.af_num(), AFType::OutputPushPull);
|
||||
cts.set_as_af(cts.af_num(), AFType::Input);
|
||||
@ -737,8 +737,8 @@ impl<'d, T: BasicInstance, TxDma, RxDma> Uart<'d, T, TxDma, RxDma> {
|
||||
into_ref!(de);
|
||||
|
||||
// UartRx and UartTx have one refcount ea.
|
||||
T::reset_and_enable();
|
||||
T::reset_and_enable();
|
||||
T::enable_and_reset();
|
||||
T::enable_and_reset();
|
||||
|
||||
de.set_as_af(de.af_num(), AFType::OutputPushPull);
|
||||
T::regs().cr3().write(|w| {
|
||||
|
Reference in New Issue
Block a user