riscv support

This commit is contained in:
Sijmen Woutersen
2022-09-25 20:10:11 +02:00
parent 059610a8de
commit 6e1120e17e
4 changed files with 16 additions and 16 deletions

View File

@ -16,6 +16,7 @@ proc-macro = true
[features]
std = []
wasm = []
riscv = []
# Enabling this cause interrupt::take! to require embassy-executor
rtos-trace-interrupt = []

View File

@ -45,7 +45,7 @@ pub fn run(args: syn::AttributeArgs, f: syn::ItemFn) -> Result<TokenStream, Toke
}
};
#[cfg(all(feature = "std", not(feature = "wasm")))]
#[cfg(all(feature = "std", not(feature = "wasm"), not(feature = "riscv")))]
let main = quote! {
fn main() -> ! {
let mut executor = ::embassy_executor::Executor::new();
@ -57,13 +57,24 @@ pub fn run(args: syn::AttributeArgs, f: syn::ItemFn) -> Result<TokenStream, Toke
}
};
#[cfg(all(not(feature = "std"), not(feature = "wasm")))]
#[cfg(all(not(feature = "std"), not(feature = "wasm"), not(feature = "riscv")))]
let main = quote! {
#[cortex_m_rt::entry]
fn main() -> ! {
let mut executor = ::embassy_executor::Executor::new();
let executor = unsafe { __make_static(&mut executor) };
executor.run(|spawner| {
spawner.must_spawn(__embassy_main(spawner));
})
}
};
#[cfg(all(not(feature = "std"), not(feature = "wasm"), feature = "riscv"))]
let main = quote! {
#[riscv_rt::entry]
fn main() -> ! {
let mut executor = ::embassy_executor::Executor::new();
let executor = unsafe { __make_static(&mut executor) };
executor.run(|spawner| {
spawner.must_spawn(__embassy_main(spawner));
})