Skip to content

Commit 85fef2d

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

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
@@ -940,12 +940,12 @@ pub mod spi {
940940

941941
/// Timing configurations for FlexCAN peripherals
942942
pub mod can {
943-
use super::{ral::ccm, Divider, Frequency};
943+
use super::{ral::ccm, Divider, Frequency, OSCILLATOR_FREQUENCY};
944944

945945
#[derive(Clone, Copy)]
946946
#[non_exhaustive] // Not all variants added
947947
pub enum ClockSelect {
948-
Pll2,
948+
OSC,
949949
}
950950

951951
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
@@ -1085,7 +1085,7 @@ pub mod can {
10851085
impl From<ClockSelect> for Frequency {
10861086
fn from(clock_select: ClockSelect) -> Self {
10871087
match clock_select {
1088-
ClockSelect::Pll2 => Frequency(528_000_000),
1088+
ClockSelect::OSC => OSCILLATOR_FREQUENCY,
10891089
}
10901090
}
10911091
}

0 commit comments

Comments
 (0)