diff options
| author | Román Cárdenas <rcardenas.rod@gmail.com> | 2023-03-29 21:07:36 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-29 21:07:36 +0200 |
| commit | ce508a1882b1cc8735c4fd901a0ad868da5fe77b (patch) | |
| tree | e17930b11f05f3bfaba59f3e579dd4f49aae4b91 /rtic-macros/src/analyze.rs | |
| parent | 06ddfb7ab8d04fa519bf66a40ec7a98a5e04aa07 (diff) | |
| parent | 31055fa64a6e178caa45f8a8e862ded6a68d3e55 (diff) | |
Merge branch 'master' into master
Diffstat (limited to 'rtic-macros/src/analyze.rs')
| -rw-r--r-- | rtic-macros/src/analyze.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/rtic-macros/src/analyze.rs b/rtic-macros/src/analyze.rs index 65774f6..2227308 100644 --- a/rtic-macros/src/analyze.rs +++ b/rtic-macros/src/analyze.rs @@ -11,6 +11,7 @@ use syn::Ident; pub struct Analysis { parent: analyze::Analysis, pub interrupts: BTreeMap<Priority, (Ident, Dispatcher)>, + pub max_async_prio: Option<u8>, } impl ops::Deref for Analysis { @@ -42,8 +43,16 @@ pub fn app(analysis: analyze::Analysis, app: &App) -> Analysis { .map(|p| (p, available_interrupt.pop().expect("UNREACHABLE"))) .collect(); + let max_async_prio = app + .hardware_tasks + .iter() + .map(|(_, task)| task.args.priority) + .min() + .map(|v| v - 1); // One less than the smallest HW task + Analysis { parent: analysis, interrupts, + max_async_prio, } } |
