diff options
author | 2023-03-29 18:32:15 +0000 | |
---|---|---|
committer | 2023-03-29 18:32:15 +0000 | |
commit | 0c2272ce258c6a4ab1fe77bdd9d41a04952a96f0 (patch) | |
tree | 62af9f2560e090c05199c527392b19269cb6b621 /rtic-macros/src | |
parent | 56f7c61aa84c6e6967f396a5b38567151e4bedb2 (diff) | |
parent | 48e5acf294c2f035bda985c1f3441df23b5fad52 (diff) | |
download | rtic-0c2272ce258c6a4ab1fe77bdd9d41a04952a96f0.tar.gz rtic-0c2272ce258c6a4ab1fe77bdd9d41a04952a96f0.tar.zst rtic-0c2272ce258c6a4ab1fe77bdd9d41a04952a96f0.zip |
Merge #710
710: Start async tasks at lowest priority r=AfoHT a=korken89
Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
Diffstat (limited to 'rtic-macros/src')
-rw-r--r-- | rtic-macros/src/syntax/parse.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/rtic-macros/src/syntax/parse.rs b/rtic-macros/src/syntax/parse.rs index 72eeeaf6..823bd82e 100644 --- a/rtic-macros/src/syntax/parse.rs +++ b/rtic-macros/src/syntax/parse.rs @@ -289,11 +289,13 @@ fn task_args(tokens: TokenStream2) -> parse::Result<Either<HardwareTaskArgs, Sof // Handle comma: , let _: Token![,] = content.parse()?; } - let priority = priority.unwrap_or(1); let shared_resources = shared_resources.unwrap_or_default(); let local_resources = local_resources.unwrap_or_default(); Ok(if let Some(binds) = binds { + // Hardware tasks can't run at anything lower than 1 + let priority = priority.unwrap_or(1); + if priority == 0 { return Err(parse::Error::new( prio_span.unwrap(), @@ -308,6 +310,9 @@ fn task_args(tokens: TokenStream2) -> parse::Result<Either<HardwareTaskArgs, Sof local_resources, }) } else { + // Software tasks start at idle priority + let priority = priority.unwrap_or(0); + Either::Right(SoftwareTaskArgs { priority, shared_resources, |