Skip to content

Commit

Permalink
fix to hard code Can clock source to OSC
Browse files Browse the repository at this point in the history
  • Loading branch information
dstric-aqueduct committed Dec 13, 2022
1 parent 0fba3e7 commit 85fef2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion imxrt-hal/src/can/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl Unclocked {
);

let clk_sel = match clock_select {
ccm::can::ClockSelect::Pll2 => ral::ccm::CSCMR2::CAN_CLK_SEL::RW::CAN_CLK_SEL_1,
ccm::can::ClockSelect::OSC => ral::ccm::CSCMR2::CAN_CLK_SEL::RW::CAN_CLK_SEL_1,
};

// Select clock, and commit prescalar
Expand Down
6 changes: 3 additions & 3 deletions imxrt-hal/src/ccm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -940,12 +940,12 @@ pub mod spi {

/// Timing configurations for FlexCAN peripherals
pub mod can {
use super::{ral::ccm, Divider, Frequency};
use super::{ral::ccm, Divider, Frequency, OSCILLATOR_FREQUENCY};

#[derive(Clone, Copy)]
#[non_exhaustive] // Not all variants added
pub enum ClockSelect {
Pll2,
OSC,
}

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
Expand Down Expand Up @@ -1085,7 +1085,7 @@ pub mod can {
impl From<ClockSelect> for Frequency {
fn from(clock_select: ClockSelect) -> Self {
match clock_select {
ClockSelect::Pll2 => Frequency(528_000_000),
ClockSelect::OSC => OSCILLATOR_FREQUENCY,
}
}
}
Expand Down

0 comments on commit 85fef2d

Please sign in to comment.