Add init fn. Initializes hw and returns Peripherals.

This commit is contained in:
Dario Nieuwenhuis
2021-05-12 01:57:01 +02:00
parent bfc7f52e6d
commit 0310e4d458
24 changed files with 217 additions and 258 deletions

View File

@ -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) };

View File

@ -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);
)
}