Now with spawn/schedule from anywhere

This commit is contained in:
Emil Fresk 2020-10-11 18:38:38 +02:00
parent c83b15b643
commit 524273c96a
19 changed files with 172 additions and 694 deletions

View file

@ -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)];));