Remove stm32.

stm32 developemnt continues in the `stm32-neo` branch for now.
This commit is contained in:
Dario Nieuwenhuis
2021-05-17 00:57:32 +02:00
parent 97b01f1c47
commit bfc7f52e6d
29 changed files with 1 additions and 4988 deletions

View File

@ -1,28 +0,0 @@
use crate::path::ModulePrefix;
use proc_macro2::TokenStream;
use quote::quote;
pub fn generate(embassy_prefix: &ModulePrefix, config: syn::Expr) -> TokenStream {
let embassy_path = embassy_prefix.append("embassy").path();
let embassy_stm32_path = embassy_prefix.append("embassy_stm32").path();
quote!(
use #embassy_stm32_path::{rtc, interrupt, Peripherals, pac, hal::rcc::RccExt, hal::time::U32Ext};
unsafe { #embassy_stm32_path::system::configure(#config) };
let (dp, clocks) = Peripherals::take().unwrap();
let mut rtc = rtc::RTC::new(dp.TIM2, interrupt::take!(TIM2), clocks);
let rtc = unsafe { make_static(&mut rtc) };
rtc.start();
let mut alarm = rtc.alarm1();
unsafe { #embassy_path::time::set_clock(rtc) };
let alarm = unsafe { make_static(&mut alarm) };
executor.set_alarm(alarm);
unsafe { Peripherals::set_peripherals(clocks) };
)
}