From 904deee8c6f89cd8c413473df9a636a5c1d33ba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edvin=20=C3=85kerfeldt?= <Edvin Ã…kerfeldt> Date: Wed, 9 Dec 2020 10:13:16 +0100 Subject: [PATCH] rtt_timing: Added task D, as notet in reviews --- examples/rtt_timing.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/examples/rtt_timing.rs b/examples/rtt_timing.rs index 96bf43a..55ea8c8 100644 --- a/examples/rtt_timing.rs +++ b/examples/rtt_timing.rs @@ -183,6 +183,18 @@ A/C = 4790151/40001 = 119,7507812 ~= 120 // Open the file in you editor and search for the `timed_loop`. // // [Assembly for function `timed_loop` here] +/* +08000232 <timed_loop>: + 8000232: movw r1, #4100 // Load 4100 into r1 (16-bit register) + 8000236: movw r2, #10000 // Load 10000 into r2 (16-bit register) + 800023a: movt r1, #57344 // + 800023e: ldr r0, [r1] // Load the content of E0001004 (probably the DWT register) into r0 + 8000240: subs r2, #1 // Decreases the loop counter with one + 8000242: nop // The instruction of the loop + 8000244: bne #-8 <timed_loop+0xe> // Branch not equal, two instructions back + 8000246: ldr r1, [r1] // Load the content of E0001004 into r1, no ide why + 8000248: bx lr // Branch back to link +*/ // // Locate the loop body, and verify that it makes sense // based on the information from the technical documentation: -- GitLab