Cleanup export and actually use rtic::export, made fn init inline

This commit is contained in:
Emil Fresk 2021-09-14 16:13:28 +02:00
parent 22ec841ee1
commit addb086070
3 changed files with 6 additions and 4 deletions

View file

@ -77,6 +77,7 @@ pub fn codegen(app: &App, analysis: &Analysis, extra: &Extra) -> CodegenResult {
let user_init = quote!( let user_init = quote!(
#(#attrs)* #(#attrs)*
#[inline(always)]
#[allow(non_snake_case)] #[allow(non_snake_case)]
fn #name(#context: #name::Context) -> (#user_init_return) { fn #name(#context: #name::Context) -> (#user_init_return) {
#(#stmts)* #(#stmts)*

View file

@ -275,7 +275,7 @@ pub fn codegen(
( (
quote!(core::mem::transmute::<_, cortex_m::peripheral::SYST>(()) quote!(core::mem::transmute::<_, cortex_m::peripheral::SYST>(())
.enable_interrupt()), .enable_interrupt()),
quote!(cortex_m::peripheral::SCB::set_pendst()), quote!(rtic::export::SCB::set_pendst()),
) )
} else { } else {
let rt_err = util::rt_err_ident(); let rt_err = util::rt_err_ident();

View file

@ -5,12 +5,10 @@ use core::{
pub use crate::tq::{NotReady, TimerQueue}; pub use crate::tq::{NotReady, TimerQueue};
pub use bare_metal::CriticalSection; pub use bare_metal::CriticalSection;
#[cfg(armv7m)]
pub use cortex_m::register::basepri;
pub use cortex_m::{ pub use cortex_m::{
asm::wfi, asm::wfi,
interrupt, interrupt,
peripheral::{scb::SystemHandler, syst::SystClkSource, DWT, NVIC}, peripheral::{scb::SystemHandler, DWT, NVIC, SCB},
Peripherals, Peripherals,
}; };
pub use heapless::sorted_linked_list::SortedLinkedList; pub use heapless::sorted_linked_list::SortedLinkedList;
@ -21,6 +19,9 @@ pub use rtic_monotonic as monotonic;
pub type SCFQ<const N: usize> = Queue<u8, N>; pub type SCFQ<const N: usize> = Queue<u8, N>;
pub type SCRQ<T, const N: usize> = Queue<(T, u8), N>; pub type SCRQ<T, const N: usize> = Queue<(T, u8), N>;
#[cfg(armv7m)]
use cortex_m::register::basepri;
#[cfg(armv7m)] #[cfg(armv7m)]
#[inline(always)] #[inline(always)]
pub fn run<F>(priority: u8, f: F) pub fn run<F>(priority: u8, f: F)