Skip to content

Commit

Permalink
Fixup formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
kevswims committed Feb 12, 2023
1 parent e434620 commit c08d39f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
5 changes: 4 additions & 1 deletion src/fdcan/interrupt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ mod tests {

let mut ints = Interrupts::RX_FIFO_0_FULL;
ints |= Interrupt::RxFifo1Full;
assert_eq!(ints, Interrupts::RX_FIFO_0_FULL | Interrupts::RX_FIFO_1_FULL);
assert_eq!(
ints,
Interrupts::RX_FIFO_0_FULL | Interrupts::RX_FIFO_1_FULL
);
}
}
26 changes: 11 additions & 15 deletions src/rcc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,17 +180,17 @@ impl Rcc {
let pll_freq = pll_input_freq / pll_cfg.m.divisor() * pll_cfg.n.multiplier();

// Calculate the output frequencies for the P, Q, and R outputs
let p = pll_cfg.p.map(|p| {
((pll_freq / p.divisor()).hz(), p.register_setting())
});
let p = pll_cfg
.p
.map(|p| ((pll_freq / p.divisor()).hz(), p.register_setting()));

let q = pll_cfg.q.map(|q| {
((pll_freq / q.divisor()).hz(), q.register_setting())
});
let q = pll_cfg
.q
.map(|q| ((pll_freq / q.divisor()).hz(), q.register_setting()));

let r = pll_cfg.r.map(|r| {
((pll_freq / r.divisor()).hz(), r.register_setting())
});
let r = pll_cfg
.r
.map(|r| ((pll_freq / r.divisor()).hz(), r.register_setting()));

// Set the M input divider, the N multiplier for the PLL, and the PLL source.
self.rb.pllcfgr.modify(|_, w| unsafe {
Expand All @@ -213,17 +213,13 @@ impl Rcc {

// Set and enable Q if requested
let w = match q {
Some((_, register_setting)) => {
w.pllq().bits(register_setting).pllqen().set_bit()
}
Some((_, register_setting)) => w.pllq().bits(register_setting).pllqen().set_bit(),
None => w,
};

// Set and enable R if requested
let w = match r {
Some((_, register_setting)) => {
w.pllr().bits(register_setting).pllren().set_bit()
}
Some((_, register_setting)) => w.pllr().bits(register_setting).pllren().set_bit(),
None => w,
};

Expand Down

0 comments on commit c08d39f

Please sign in to comment.