Add init
fn. Initializes hw and returns Peripherals.
This commit is contained in:
@ -9,7 +9,7 @@ pub fn generate(embassy_prefix: &ModulePrefix, config: syn::Expr) -> TokenStream
|
||||
quote!(
|
||||
use #embassy_nrf_path::{interrupt, peripherals, rtc};
|
||||
|
||||
unsafe { #embassy_nrf_path::system::configure(#config) };
|
||||
let p = #embassy_nrf_path::init(#config);
|
||||
|
||||
let mut rtc = rtc::RTC::new(unsafe { <peripherals::RTC1 as #embassy_path::util::Steal>::steal() }, interrupt::take!(RTC1));
|
||||
let rtc = unsafe { make_static(&mut rtc) };
|
||||
|
@ -7,6 +7,6 @@ pub fn generate(embassy_prefix: &ModulePrefix, config: syn::Expr) -> TokenStream
|
||||
quote!(
|
||||
use #embassy_rp_path::{interrupt, peripherals};
|
||||
|
||||
unsafe { #embassy_rp_path::system::configure(#config) };
|
||||
let p = #embassy_rp_path::init(#config);
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user