stm32h7: Use unwrap!

This commit is contained in:
Ben Gamari 2021-07-31 12:32:14 -04:00 committed by Dario Nieuwenhuis
parent e44acd0d56
commit 41aaff95f8

View File

@ -120,7 +120,7 @@ impl<'d> Rcc<'d> {
unsafe { pll_setup(srcclk.0, &self.config.pll3, 2) }; unsafe { pll_setup(srcclk.0, &self.config.pll3, 2) };
let sys_ck = if sys_use_pll1_p { let sys_ck = if sys_use_pll1_p {
Hertz(pll1_p_ck.unwrap()) // Must have been set by sys_ck_setup Hertz(unwrap!(pll1_p_ck)) // Must have been set by sys_ck_setup
} else { } else {
sys_ck sys_ck
}; };
@ -390,7 +390,7 @@ impl<'d> Rcc<'d> {
// set. The traceclk mux is synchronous with the system // set. The traceclk mux is synchronous with the system
// clock mux, but has pll1_r_ck as an input. In order to // clock mux, but has pll1_r_ck as an input. In order to
// keep traceclk running, we force a pll1_r_ck. // keep traceclk running, we force a pll1_r_ck.
(true, None) => Some(Hertz(self.config.pll1.p_ck.unwrap().0 / 2)), (true, None) => Some(Hertz(unwrap!(self.config.pll1.p_ck).0 / 2)),
// Either pll1 not selected as system clock, free choice // Either pll1 not selected as system clock, free choice
// of pll1_r_ck. Or pll1 is selected, assume user has set // of pll1_r_ck. Or pll1 is selected, assume user has set