aboutsummaryrefslogtreecommitdiff
path: root/embassy-mspm0/src/uart/mod.rs
diff options
context:
space:
mode:
authorRaul Alimbekov <[email protected]>2025-12-16 09:05:22 +0300
committerGitHub <[email protected]>2025-12-16 09:05:22 +0300
commitc9a04b4b732b7a3b696eb8223664c1a7942b1875 (patch)
tree6dbe5c02e66eed8d8762f13f95afd24f8db2b38c /embassy-mspm0/src/uart/mod.rs
parentcde24a3ef1117653ba5ed4184102b33f745782fb (diff)
parent5ae6e060ec1c90561719aabdc29d5b6e7b8b0a82 (diff)
Merge branch 'main' into main
Diffstat (limited to 'embassy-mspm0/src/uart/mod.rs')
-rw-r--r--embassy-mspm0/src/uart/mod.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/embassy-mspm0/src/uart/mod.rs b/embassy-mspm0/src/uart/mod.rs
index 6599cea06..03e68d297 100644
--- a/embassy-mspm0/src/uart/mod.rs
+++ b/embassy-mspm0/src/uart/mod.rs
@@ -3,17 +3,17 @@
3mod buffered; 3mod buffered;
4 4
5use core::marker::PhantomData; 5use core::marker::PhantomData;
6use core::sync::atomic::{compiler_fence, AtomicU32, Ordering}; 6use core::sync::atomic::{AtomicU32, Ordering, compiler_fence};
7 7
8pub use buffered::*; 8pub use buffered::*;
9use embassy_embedded_hal::SetConfig; 9use embassy_embedded_hal::SetConfig;
10use embassy_hal_internal::PeripheralType; 10use embassy_hal_internal::PeripheralType;
11 11
12use crate::Peri;
12use crate::gpio::{AnyPin, PfType, Pull, SealedPin}; 13use crate::gpio::{AnyPin, PfType, Pull, SealedPin};
13use crate::interrupt::{Interrupt, InterruptExt}; 14use crate::interrupt::{Interrupt, InterruptExt};
14use crate::mode::{Blocking, Mode}; 15use crate::mode::{Blocking, Mode};
15use crate::pac::uart::{vals, Uart as Regs}; 16use crate::pac::uart::{Uart as Regs, vals};
16use crate::Peri;
17 17
18/// The clock source for the UART. 18/// The clock source for the UART.
19#[derive(Clone, Copy, PartialEq, Eq, Debug)] 19#[derive(Clone, Copy, PartialEq, Eq, Debug)]
@@ -931,8 +931,7 @@ fn set_baudrate_inner(regs: Regs, clock: u32, baudrate: u32) -> Result<(), Confi
931 let Some(min_clock) = baudrate.checked_mul(oversampling as u32) else { 931 let Some(min_clock) = baudrate.checked_mul(oversampling as u32) else {
932 trace!( 932 trace!(
933 "{}x oversampling would cause overflow for clock: {} Hz", 933 "{}x oversampling would cause overflow for clock: {} Hz",
934 oversampling, 934 oversampling, clock
935 clock
936 ); 935 );
937 continue; 936 continue;
938 }; 937 };
@@ -945,9 +944,7 @@ fn set_baudrate_inner(regs: Regs, clock: u32, baudrate: u32) -> Result<(), Confi
945 for &(div, div_value) in &DIVS { 944 for &(div, div_value) in &DIVS {
946 trace!( 945 trace!(
947 "Trying div: {}, oversampling {} for {} baud", 946 "Trying div: {}, oversampling {} for {} baud",
948 div, 947 div, oversampling, baudrate
949 oversampling,
950 baudrate
951 ); 948 );
952 949
953 let Some((ibrd, fbrd)) = calculate_brd(clock, div, baudrate, oversampling) else { 950 let Some((ibrd, fbrd)) = calculate_brd(clock, div, baudrate, oversampling) else {