Enable clock by default for stm32l0

Modify init function to return a Clock instance defined by a per-chip
SystemClock type and use this in macro setup

A proof of concept implementation for STM32 L0 chips.

This allows using embassy::main macros for STM32 devices that have the
clock setup logic.
This commit is contained in:
Ulf Lilleengen
2021-05-25 17:09:01 +02:00
parent a126e17fb2
commit c501b162fc
7 changed files with 614 additions and 25 deletions

View File

@ -6,8 +6,10 @@ cfg_if::cfg_if! {
mod l0;
pub use l0::*;
} else {
pub type SystemClock = ();
#[derive(Default)]
pub struct Config {}
pub fn init(_config: Config) {}
pub unsafe fn init(_config: Config) -> SystemClock {
}
}
}