macros: initialize chip before executor.

The executor will call into the chip's time-driver, which may need the chip
to be initialized.
This commit is contained in:
Dario Nieuwenhuis 2022-01-05 13:30:46 +01:00
parent 58e9dfbc00
commit caf48d8a95

View file

@ -370,16 +370,14 @@ pub fn main(args: TokenStream, item: TokenStream) -> TokenStream {
::core::mem::transmute(t)
}
let mut executor = #embassy_path::executor::Executor::new();
let executor = unsafe { make_static(&mut executor) };
#chip_setup
let mut executor = #embassy_path::executor::Executor::new();
let executor = unsafe { make_static(&mut executor) };
executor.run(|spawner| {
spawner.must_spawn(__embassy_main(spawner, p));
})
}
};
result.into()