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

timing_resources, Q6-Q13 done

parent d7a327d2
Branches
No related tags found
No related merge requests found
......@@ -40,9 +40,9 @@ const APP: () = {
rtic::pend(stm32f411::Interrupt::EXTI0);
asm::bkpt();
cx.resources.shared.lock(|shared| {
// asm::bkpt();
asm::bkpt();
*shared += 1;
// asm::bkpt();
asm::bkpt();
});
asm::bkpt();
}
......@@ -168,6 +168,9 @@ Yes, but very minimal. The only thing that needs to be infered is the changing o
// (gdb) x 0xe0001004
//
// [Your answer here]
/*
37 cycles
*/
//
// You should have a total execution time in the range of 30-40 cycles.
//
......@@ -175,6 +178,9 @@ Yes, but very minimal. The only thing that needs to be infered is the changing o
// `exti0` was safe without locking the resource.
//
// [Your answer here]
/*
It was safe because exti0 had the highest priority of the tasks accessing the resource.
*/
//
// In `exti1` we also access `shared` but this time through a lock.
//
......@@ -204,10 +210,16 @@ Yes, but very minimal. The only thing that needs to be infered is the changing o
// (gdb) x 0xe0001004
//
// [Your answer here]
/*
52 cycles
*/
//
// Calculate the total time (in cycles), for this section of code.
//
// [Your answer here]
/*
52 - 37 = 15 cycles
*/
//
// You should get a value around 15 cycles.
//
......@@ -248,6 +260,9 @@ Yes, but very minimal. The only thing that needs to be infered is the changing o
// (gdb) x 0xe0001004
//
// [Your answer here]
/*
40 cycles
*/
//
// (gdb) c
//
......@@ -258,6 +273,9 @@ Yes, but very minimal. The only thing that needs to be infered is the changing o
// (gdb) x 0xe0001004
//
// [Your answer here]
/*
50 cycles
*/
//
// From a real-time perspective the critical section infers
// blocking (of higher priority tasks).
......@@ -265,6 +283,9 @@ Yes, but very minimal. The only thing that needs to be infered is the changing o
// How many clock cycles is the blocking?
//
// [Your answer here]
/*
10 cycles
*/
//
// Finally continue out of the closure.
//
......@@ -275,6 +296,9 @@ Yes, but very minimal. The only thing that needs to be infered is the changing o
// (gdb) x 0xe0001004
//
// [Your answer here]
/*
52 cycles
*/
//
// This is the total execution time of:
//
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment