Skip to content
Snippets Groups Projects
Commit 7bf39007 authored by Edvin Åkerfeldt's avatar Edvin Åkerfeldt
Browse files

Updated how we compute response time

parent 7aeeb35f
No related branches found
No related tags found
No related merge requests found
...@@ -40,7 +40,7 @@ const APP: () = { ...@@ -40,7 +40,7 @@ const APP: () = {
#[inline(never)] #[inline(never)]
#[task(schedule = [t1], priority = 1)] #[task(schedule = [t1], priority = 1)]
fn t1(cx: t1::Context) { fn t1(cx: t1::Context) {
let start = Instant::now(); //let start = Instant::now();
asm::bkpt(); asm::bkpt();
cx.schedule.t1(cx.scheduled + 100_000.cycles()).unwrap(); cx.schedule.t1(cx.scheduled + 100_000.cycles()).unwrap();
asm::bkpt(); asm::bkpt();
...@@ -50,7 +50,7 @@ const APP: () = { ...@@ -50,7 +50,7 @@ const APP: () = {
// 2) your code here to update T1_MAX_RP and // 2) your code here to update T1_MAX_RP and
// break if deadline missed // break if deadline missed
let resp: u32= start.elapsed().as_cycles(); let resp: u32= cx.scheduled.elapsed().as_cycles();
if resp > 100_000 { if resp > 100_000 {
//panic!(); //panic!();
asm::bkpt(); asm::bkpt();
...@@ -67,7 +67,7 @@ const APP: () = { ...@@ -67,7 +67,7 @@ const APP: () = {
#[inline(never)] #[inline(never)]
#[task(schedule = [t2], resources = [R1, R2], priority = 2)] #[task(schedule = [t2], resources = [R1, R2], priority = 2)]
fn t2(mut cx: t2::Context) { fn t2(mut cx: t2::Context) {
let start = Instant::now(); //let start = Instant::now();
asm::bkpt(); asm::bkpt();
cx.schedule.t2(cx.scheduled + 200_000.cycles()).unwrap(); cx.schedule.t2(cx.scheduled + 200_000.cycles()).unwrap();
...@@ -95,7 +95,7 @@ const APP: () = { ...@@ -95,7 +95,7 @@ const APP: () = {
// 2) your code here to update T2_MAX_RP and // 2) your code here to update T2_MAX_RP and
// break if deadline missed // break if deadline missed
let resp: u32= start.elapsed().as_cycles(); let resp: u32= cx.scheduled.elapsed().as_cycles();
if resp > 200_000 { if resp > 200_000 {
//panic!(); //panic!();
asm::bkpt(); asm::bkpt();
...@@ -112,7 +112,7 @@ const APP: () = { ...@@ -112,7 +112,7 @@ const APP: () = {
#[inline(never)] #[inline(never)]
#[task(schedule = [t3], resources = [R2], priority = 3)] #[task(schedule = [t3], resources = [R2], priority = 3)]
fn t3(cx: t3::Context) { fn t3(cx: t3::Context) {
let start = Instant::now(); //let start = Instant::now();
asm::bkpt(); asm::bkpt();
cx.schedule.t3(cx.scheduled + 50_000.cycles()).unwrap(); cx.schedule.t3(cx.scheduled + 50_000.cycles()).unwrap();
asm::bkpt(); asm::bkpt();
...@@ -129,7 +129,7 @@ const APP: () = { ...@@ -129,7 +129,7 @@ const APP: () = {
// 2) your code here to update T3_MAX_RP and // 2) your code here to update T3_MAX_RP and
// break if deadline missed // break if deadline missed
let resp: u32= start.elapsed().as_cycles(); let resp: u32= cx.scheduled.elapsed().as_cycles();
if resp > 50_000 { if resp > 50_000 {
//panic!(); //panic!();
asm::bkpt(); asm::bkpt();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment