From fc4cb7d472dad1ea0fa137bb116bd907efc19601 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Mon, 8 May 2017 12:05:42 -0500 Subject: replace the ceiling token with a preemption threshold token --- tests/cfail/access.rs | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'tests/cfail/access.rs') 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 = Resource::new(0); static R2: Resource = Resource::new(0); @@ -9,27 +9,27 @@ static R4: Resource = Resource::new(0); static R5: Resource = Resource::new(0); static R6: Resource = 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); } ); } -- cgit v1.2.3