Skip to content

Commit 0b53b30

Browse files
fix to hard code Can clock source to OSC
see: imxrt-rs#122 (comment)
1 parent ea60249 commit 0b53b30

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

imxrt-hal/src/can/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl Unclocked {
5151
);
5252

5353
let clk_sel = match clock_select {
54-
ccm::can::ClockSelect::Pll2 => ral::ccm::CSCMR2::CAN_CLK_SEL::RW::CAN_CLK_SEL_1,
54+
ccm::can::ClockSelect::OSC => ral::ccm::CSCMR2::CAN_CLK_SEL::RW::CAN_CLK_SEL_1,
5555
};
5656

5757
// Select clock, and commit prescalar

imxrt-hal/src/ccm.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -968,12 +968,12 @@ pub mod spi {
968968

969969
/// Timing configurations for FlexCAN peripherals
970970
pub mod can {
971-
use super::{ral::ccm, Divider, Frequency};
971+
use super::{ral::ccm, Divider, Frequency, OSCILLATOR_FREQUENCY};
972972

973973
#[derive(Clone, Copy)]
974974
#[non_exhaustive] // Not all variants added
975975
pub enum ClockSelect {
976-
Pll2,
976+
OSC,
977977
}
978978

979979
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
@@ -1113,7 +1113,7 @@ pub mod can {
11131113
impl From<ClockSelect> for Frequency {
11141114
fn from(clock_select: ClockSelect) -> Self {
11151115
match clock_select {
1116-
ClockSelect::Pll2 => Frequency(528_000_000),
1116+
ClockSelect::OSC => OSCILLATOR_FREQUENCY,
11171117
}
11181118
}
11191119
}

0 commit comments

Comments
 (0)