stm32: use embassy::main in more places

This commit is contained in:
xoviat
2021-03-29 09:18:48 -05:00
parent a3d876bf46
commit 32ca231fe6
3 changed files with 18 additions and 61 deletions

View File

@ -11,6 +11,8 @@ pub struct Args {
pub sysclk: Option<u32>,
#[darling(default)]
pub pclk1: Option<u32>,
#[darling(default)]
pub require_pll48clk: bool,
}
pub fn generate(args: Args) -> TokenStream {
@ -30,6 +32,10 @@ pub fn generate(args: Args) -> TokenStream {
clock_cfg_args = quote! { #clock_cfg_args.pclk1(#mhz.mhz()) };
}
if args.require_pll48clk {
clock_cfg_args = quote! { #clock_cfg_args.require_pll48clk() };
}
quote!(
use embassy_stm32::{rtc, interrupt, Peripherals, pac, hal::rcc::RccExt, hal::time::U32Ext};