aboutsummaryrefslogtreecommitdiff
path: root/macros/src/codegen/pre_init.rs
diff options
context:
space:
mode:
Diffstat (limited to 'macros/src/codegen/pre_init.rs')
-rw-r--r--macros/src/codegen/pre_init.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/macros/src/codegen/pre_init.rs b/macros/src/codegen/pre_init.rs
index 9c5f35ec..bc87b1df 100644
--- a/macros/src/codegen/pre_init.rs
+++ b/macros/src/codegen/pre_init.rs
@@ -12,10 +12,10 @@ pub fn codegen(app: &App, analysis: &Analysis, extra: &Extra) -> Vec<TokenStream
stmts.push(quote!(rtic::export::interrupt::disable();));
// Populate the FreeQueue
- for fq in &analysis.free_queues {
+ for fq in &app.software_tasks {
// Get the task name
let name = fq.0;
- let task = &app.software_tasks[name];
+ let task = fq.1;
let cap = task.args.capacity;
let fq_ident = util::fq_ident(name);
@@ -81,8 +81,8 @@ pub fn codegen(app: &App, analysis: &Analysis, extra: &Extra) -> Vec<TokenStream
}
// Initialize the SysTick if there exist a TimerQueue
- if let Some(tq) = analysis.timer_queues.first() {
- let priority = tq.priority;
+ if extra.monotonic.is_some() {
+ let priority = analysis.channels.keys().max().unwrap();
// Compile time assert that this priority is supported by the device
stmts.push(quote!(let _ = [(); ((1 << #nvic_prio_bits) - #priority as usize)];));