mirror of
https://github.com/embassy-rs/embassy.git
synced 2025-09-28 04:40:39 +00:00
feat(stm32-wba): provide a const
constructor on rcc::Config
This commit is contained in:
parent
da86052586
commit
576241fe2a
@ -37,9 +37,9 @@ pub struct Config {
|
||||
pub mux: super::mux::ClockMux,
|
||||
}
|
||||
|
||||
impl Default for Config {
|
||||
impl Config {
|
||||
#[inline]
|
||||
fn default() -> Config {
|
||||
pub const fn new() -> Self {
|
||||
Config {
|
||||
hse: None,
|
||||
hsi: true,
|
||||
@ -48,13 +48,20 @@ impl Default for Config {
|
||||
apb1_pre: APBPrescaler::DIV1,
|
||||
apb2_pre: APBPrescaler::DIV1,
|
||||
apb7_pre: APBPrescaler::DIV1,
|
||||
ls: Default::default(),
|
||||
ls: crate::rcc::LsConfig::new(),
|
||||
voltage_scale: VoltageScale::RANGE2,
|
||||
mux: Default::default(),
|
||||
mux: super::mux::ClockMux::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Config {
|
||||
#[inline]
|
||||
fn default() -> Config {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
fn hsi_enable() {
|
||||
RCC.cr().modify(|w| w.set_hsion(true));
|
||||
while !RCC.cr().read().hsirdy() {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user