mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-18 22:05:37 +01:00
Merge branch 'master' into spawn_experiment
This commit is contained in:
commit
5ac16f6aae
8 changed files with 58 additions and 18 deletions
|
|
@ -135,7 +135,7 @@ pub fn app(app: &App, analysis: &Analysis, extra: &Extra) -> TokenStream2 {
|
|||
/// Implementation details
|
||||
mod #name {
|
||||
/// Always include the device crate which contains the vector table
|
||||
use #device as _;
|
||||
use #device as you_must_enable_the_rt_feature_for_the_pac_in_your_cargo_toml;
|
||||
#(#imports)*
|
||||
#(#user_imports)*
|
||||
|
||||
|
|
|
|||
|
|
@ -49,14 +49,14 @@ pub fn codegen(app: &App, analysis: &Analysis, extra: &Extra) -> Vec<TokenStream
|
|||
let interrupt = util::interrupt_ident();
|
||||
stmts.push(quote!(
|
||||
core.NVIC.set_priority(
|
||||
#device::#interrupt::#name,
|
||||
you_must_enable_the_rt_feature_for_the_pac_in_your_cargo_toml::#interrupt::#name,
|
||||
rtic::export::logical2hw(#priority, #nvic_prio_bits),
|
||||
);
|
||||
));
|
||||
|
||||
// NOTE unmask the interrupt *after* setting its priority: changing the priority of a pended
|
||||
// interrupt is implementation defined
|
||||
stmts.push(quote!(rtic::export::NVIC::unmask(#device::#interrupt::#name);));
|
||||
stmts.push(quote!(rtic::export::NVIC::unmask(you_must_enable_the_rt_feature_for_the_pac_in_your_cargo_toml::#interrupt::#name);));
|
||||
}
|
||||
|
||||
// Set exception priorities
|
||||
|
|
|
|||
|
|
@ -62,7 +62,6 @@ pub fn codegen(app: &App, analysis: &Analysis, extra: &Extra) -> Vec<TokenStream
|
|||
|
||||
// Timer queue handler
|
||||
{
|
||||
let device = extra.device;
|
||||
let arms = app
|
||||
.software_tasks
|
||||
.iter()
|
||||
|
|
@ -76,7 +75,7 @@ pub fn codegen(app: &App, analysis: &Analysis, extra: &Extra) -> Vec<TokenStream
|
|||
|
||||
let pend = {
|
||||
quote!(
|
||||
rtic::pend(#device::#enum_::#interrupt);
|
||||
rtic::pend(you_must_enable_the_rt_feature_for_the_pac_in_your_cargo_toml::#enum_::#interrupt);
|
||||
)
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ pub fn instants_ident(task: &Ident) -> Ident {
|
|||
|
||||
pub fn interrupt_ident() -> Ident {
|
||||
let span = Span::call_site();
|
||||
Ident::new("Interrupt", span)
|
||||
Ident::new("interrupt", span)
|
||||
}
|
||||
|
||||
/// Whether `name` is an exception with configurable priority
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue