Further work sharing config for example and removing duplicated code.

This commit is contained in:
Bob McWhirter
2021-08-04 13:39:02 -04:00
parent 4fe9114695
commit f4971fbb79
6 changed files with 25 additions and 73 deletions

View File

@ -68,6 +68,7 @@ pub struct Config {
pub pll1: PllConfig,
pub pll2: PllConfig,
pub pll3: PllConfig,
pub enable_dma1: bool,
}
pub struct Rcc<'d> {
@ -325,6 +326,10 @@ impl<'d> Rcc<'d> {
});
while !SYSCFG.cccsr().read().ready() {}
if self.config.enable_dma1 {
RCC.ahb1enr().modify(|w| w.set_dma1en(true));
}
CoreClocks {
hclk: Hertz(rcc_hclk),
pclk1: Hertz(rcc_pclk1),