aboutsummaryrefslogtreecommitdiff
path: root/macros/src/codegen/timer_queue.rs
diff options
context:
space:
mode:
authorGravatar Emil Fresk <emil.fresk@gmail.com> 2020-12-12 23:24:54 +0100
committerGravatar Emil Fresk <emil.fresk@gmail.com> 2020-12-12 23:24:54 +0100
commit8e8ec9b7b879adae8d4de6cb2320b9b19290a7e0 (patch)
tree73f8c0664b9af8a9d98f54aabcd6ea6cd59a6765 /macros/src/codegen/timer_queue.rs
parent97a48983d2859740983cbf342e1287182426ed44 (diff)
downloadrtic-8e8ec9b7b879adae8d4de6cb2320b9b19290a7e0.tar.gz
rtic-8e8ec9b7b879adae8d4de6cb2320b9b19290a7e0.tar.zst
rtic-8e8ec9b7b879adae8d4de6cb2320b9b19290a7e0.zip
Monotonic codegen now passing compile stage
Diffstat (limited to 'macros/src/codegen/timer_queue.rs')
-rw-r--r--macros/src/codegen/timer_queue.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/macros/src/codegen/timer_queue.rs b/macros/src/codegen/timer_queue.rs
index f219eef2..dc298355 100644
--- a/macros/src/codegen/timer_queue.rs
+++ b/macros/src/codegen/timer_queue.rs
@@ -67,6 +67,8 @@ pub fn codegen(app: &App, analysis: &Analysis, _extra: &Extra) -> Vec<TokenStrea
// Timer queue handler
{
+ let enum_ = util::interrupt_ident();
+
let arms = app
.software_tasks
.iter()
@@ -75,7 +77,6 @@ pub fn codegen(app: &App, analysis: &Analysis, _extra: &Extra) -> Vec<TokenStrea
let priority = task.args.priority;
let rq = util::rq_ident(priority);
let rqt = util::spawn_t_ident(priority);
- let enum_ = util::interrupt_ident();
// The interrupt that runs the task dispatcher
let interrupt = &analysis.interrupts.get(&priority).expect("RTIC-ICE: interrupt not found").0;
@@ -98,12 +99,15 @@ pub fn codegen(app: &App, analysis: &Analysis, _extra: &Extra) -> Vec<TokenStrea
.collect::<Vec<_>>();
let bound_interrupt = &monotonic.args.binds;
+
items.push(quote!(
#[no_mangle]
unsafe fn #bound_interrupt() {
use rtic::Mutex as _;
- while let Some((task, index)) = rtic::export::interrupt::free(|_| #tq.dequeue())
+ while let Some((task, index)) = rtic::export::interrupt::free(|_| #tq.dequeue(
+ || rtic::export::NVIC::unmask(you_must_enable_the_rt_feature_for_the_pac_in_your_cargo_toml::#enum_::#bound_interrupt),
+ ))
{
match task {
#(#arms)*