diff options
| author | Jorge Aparicio <jorge@japaric.io> | 2017-07-04 11:26:11 -0500 |
|---|---|---|
| committer | Jorge Aparicio <jorge@japaric.io> | 2017-07-04 11:26:11 -0500 |
| commit | 86a360a3964ecb04a37c0424c76d7b43a9fd40fe (patch) | |
| tree | cbf0ebee17a588f8f004bdd27e590ee6c958761b /tests/cfail/raise.rs | |
| parent | 2bf5401439df4494b33ef87201ee013eb1f167e8 (diff) | |
rtfm! macro take 2
Diffstat (limited to 'tests/cfail/raise.rs')
| -rw-r--r-- | tests/cfail/raise.rs | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/tests/cfail/raise.rs b/tests/cfail/raise.rs deleted file mode 100644 index 3d7e564..0000000 --- a/tests/cfail/raise.rs +++ /dev/null @@ -1,24 +0,0 @@ -extern crate cortex_m_rtfm as rtfm; - -use rtfm::{C2, CMax, P1, P3, Resource, T1, T3}; - -static R1: Resource<i32, C2> = Resource::new(0); - -// You CAN'T use `raise` to lower the preemption level -fn j1(prio: P3, thr: T3) { - thr.raise(&R1, |thr| {}); - //~^ error -} - -static R2: Resource<i32, CMax> = Resource::new(0); - -// You CAN'T `raise` the preemption level to the maximum -fn j2(prio: P1, thr: T1) { - thr.raise(&R2, |thr| {}); - //~^ error - - // Instead use `rtfm::atomic` to access a resource with ceiling C16 - rtfm::atomic(|thr| { - let r2 = R2.access(&prio, thr); - }); -} |
