mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-19 06:15:45 +01:00
Adding a limit that async HALs can read and have as max prio
This commit is contained in:
parent
3a0e2ac924
commit
323b847bf6
4 changed files with 32 additions and 0 deletions
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue