mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-18 13:55:23 +01:00
Add test for spawning a local task from a different prio
This ensures that there is no method on the spawning task's local spawner for spawning the local task with the other priority.
This commit is contained in:
parent
5bb3ba984d
commit
f10d2b9efd
1 changed files with 25 additions and 0 deletions
25
rtic-macros/ui/spawn-local-different-exec.rs
Normal file
25
rtic-macros/ui/spawn-local-different-exec.rs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock, dispatchers = [EXTI0])]
|
||||
mod app {
|
||||
use super::*;
|
||||
|
||||
#[shared]
|
||||
struct Shared {}
|
||||
|
||||
#[local]
|
||||
struct Local {}
|
||||
|
||||
#[init]
|
||||
fn init(_cx: init::Context) -> (Shared, Local) {
|
||||
(Shared {}, Local {})
|
||||
}
|
||||
|
||||
#[task(priority = 1, is_local_task = true)]
|
||||
async fn foo(_cx: foo::Context) {}
|
||||
|
||||
#[task(priority = 2)]
|
||||
async fn bar(cx: bar::Context) {
|
||||
cx.local_spawner.foo().ok();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue