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

@ -14,7 +14,6 @@ proc-macro2 = "1.0.24"
proc-macro = true
[features]
stm32 = []
nrf = []
rp = []
std = []

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

View File

@ -267,10 +267,6 @@ pub fn interrupt_take(item: TokenStream) -> TokenStream {
#[path = "chip/nrf.rs"]
mod chip;
#[cfg(feature = "stm32")]
#[path = "chip/stm32.rs"]
mod chip;
#[cfg(feature = "rp")]
#[path = "chip/rp.rs"]
mod chip;
@ -284,7 +280,7 @@ struct MainArgs {
config: Option<syn::LitStr>,
}
#[cfg(any(feature = "nrf", feature = "stm32", feature = "rp"))]
#[cfg(any(feature = "nrf", feature = "rp"))]
#[proc_macro_attribute]
pub fn main(args: TokenStream, item: TokenStream) -> TokenStream {
let macro_args = syn::parse_macro_input!(args as syn::AttributeArgs);