aboutsummaryrefslogtreecommitdiff
path: root/tests/cfail/access.rs
diff options
context:
space:
mode:
authorJorge Aparicio <jorge@japaric.io>2017-05-08 12:05:42 -0500
committerJorge Aparicio <jorge@japaric.io>2017-05-08 12:05:42 -0500
commitfc4cb7d472dad1ea0fa137bb116bd907efc19601 (patch)
treedd3e462f3fa683ed26c2f6dcd4a2d8be504231c7 /tests/cfail/access.rs
parent2063697c626a7547f5d9fb140fbc7eb9773a5120 (diff)
replace the ceiling token with a preemption threshold token
Diffstat (limited to 'tests/cfail/access.rs')
-rw-r--r--tests/cfail/access.rs30
1 files changed, 15 insertions, 15 deletions
diff --git a/tests/cfail/access.rs b/tests/cfail/access.rs
index 7524b06..b35fb37 100644
--- a/tests/cfail/access.rs
+++ b/tests/cfail/access.rs
@@ -1,6 +1,6 @@
extern crate cortex_m_rtfm as rtfm;
-use rtfm::{C1, C2, C3, C4, C5, P2, Resource};
+use rtfm::{C1, C2, C3, C4, C5, P2, Resource, T2};
static R1: Resource<i32, C4> = Resource::new(0);
static R2: Resource<i32, C3> = Resource::new(0);
@@ -9,27 +9,27 @@ static R4: Resource<i32, C5> = Resource::new(0);
static R5: Resource<i32, C1> = Resource::new(0);
static R6: Resource<i32, C2> = Resource::new(0);
-fn j1(prio: P2, ceil: C2) {
- ceil.raise(
- &R1, |ceil| {
- // NOTE SC = System Ceiling, P = task Priority
+fn j1(prio: P2, thr: T2) {
+ thr.raise(
+ &R1, |thr| {
+ // NOTE PT = Preemption Threshold, TP = Task Priority
- // CAN access a resource with ceiling RC when SC > RC
- let r2 = R2.access(&prio, ceil);
+ // CAN access a resource with ceiling RC when PT > RC
+ let r2 = R2.access(&prio, thr);
- // CAN access a resource with ceiling RC when SC == RC
- let r3 = R3.access(&prio, ceil);
+ // CAN access a resource with ceiling RC when PT == RC
+ let r3 = R3.access(&prio, thr);
- // CAN'T access a resource with ceiling RC when SC < RC
- let r4 = R4.access(&prio, ceil);
+ // CAN'T access a resource with ceiling RC when PT < RC
+ let r4 = R4.access(&prio, thr);
//~^ error
- // CAN'T access a resource with ceiling RC when RC < P
- let r5 = R5.access(&prio, ceil);
+ // CAN'T access a resource with ceiling RC when RC < TP
+ let r5 = R5.access(&prio, thr);
//~^ error
- // CAN access a resource with ceiling RC when RC == P
- let r6 = R6.access(&prio, ceil);
+ // CAN access a resource with ceiling RC when RC == tP
+ let r6 = R6.access(&prio, thr);
}
);
}