diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-09-04 07:50:13 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-04 07:50:13 +0000 |
| commit | 7506bd8ae0ba335fc058c2138438fab5f20f6dab (patch) | |
| tree | fe65b335b19171370bd6be0bd5cd6b776a1d6110 /macros/src/analyze.rs | |
| parent | c5e6d1fa49e3596227a8ee8fe89e2e4f66db3169 (diff) | |
| parent | ad2b80907899cc335edcebfc77ae4b4b51272b87 (diff) | |
Merge #355
355: Multi-core removal r=korken89 a=AfoHT
Dependent on https://github.com/rtic-rs/rtic-syntax/pull/27
With the same reasoning as ^^
For now the testing is done against my rtic-syntax/multiremove-branch, but before we merge it should corrected.
Co-authored-by: Henrik Tjäder <henrik@tjaders.com>
Diffstat (limited to 'macros/src/analyze.rs')
| -rw-r--r-- | macros/src/analyze.rs | 41 |
1 files changed, 15 insertions, 26 deletions
diff --git a/macros/src/analyze.rs b/macros/src/analyze.rs index af6811f..38018c8 100644 --- a/macros/src/analyze.rs +++ b/macros/src/analyze.rs @@ -4,14 +4,14 @@ use std::collections::{BTreeMap, BTreeSet}; use rtic_syntax::{ analyze::{self, Priority}, ast::App, - Core, P, + P, }; use syn::Ident; /// Extend the upstream `Analysis` struct with our field pub struct Analysis { parent: P<analyze::Analysis>, - pub interrupts: BTreeMap<Core, BTreeMap<Priority, Ident>>, + pub interrupts: BTreeMap<Priority, Ident>, } impl ops::Deref for Analysis { @@ -25,31 +25,20 @@ impl ops::Deref for Analysis { // Assign an `extern` interrupt to each priority level pub fn app(analysis: P<analyze::Analysis>, app: &App) -> P<Analysis> { let mut interrupts = BTreeMap::new(); - for core in 0..app.args.cores { - let priorities = app - .software_tasks - .values() - .filter_map(|task| { - if task.args.core == core { - Some(task.args.priority) - } else { - None - } - }) - .chain(analysis.timer_queues.get(&core).map(|tq| tq.priority)) - .collect::<BTreeSet<_>>(); + let priorities = app + .software_tasks + .values() + .filter_map(|task| Some(task.args.priority)) + .chain(analysis.timer_queues.first().map(|tq| tq.priority)) + .collect::<BTreeSet<_>>(); - if !priorities.is_empty() { - interrupts.insert( - core, - priorities - .iter() - .cloned() - .rev() - .zip(app.extern_interrupts[&core].keys().cloned()) - .collect(), - ); - } + if !priorities.is_empty() { + interrupts = priorities + .iter() + .cloned() + .rev() + .zip(app.extern_interrupts.keys().cloned()) + .collect(); } P::new(Analysis { |
