From ecba84321f8013781d36913b0f37fa7867e5cac9 Mon Sep 17 00:00:00 2001
From: Blinningjr <nicke.l@telia.com>
Date: Wed, 2 Dec 2020 17:51:52 +0100
Subject: [PATCH] rtt_timing F

---
 examples/rtt_timing.rs | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/examples/rtt_timing.rs b/examples/rtt_timing.rs
index 13796fa..52fc758 100644
--- a/examples/rtt_timing.rs
+++ b/examples/rtt_timing.rs
@@ -1,6 +1,6 @@
 //! examples/rtt_timing.rs
 
-#![deny(unsafe_code)]
+// #![deny(unsafe_code)]
 #![deny(warnings)]
 #![no_main]
 #![no_std]
@@ -22,6 +22,9 @@ const APP: () = {
         cx.core.DWT.enable_cycle_counter();
 
         rprintln!("start timed_loop");
+        unsafe {
+            cx.core.DWT.cyccnt.write(0);
+        }
         let (start, end) = timed_loop();
         rprintln!(
             "start {}, end {}, diff {}",
@@ -348,9 +351,10 @@ fn timed_loop() -> (u32, u32) {
 // (when hitting the `timed_loop` breakpoint)?
 //
 // [Your answer here]
+// 0x00000009
 //
 // ------------------------------------------------------------------------
-// F) Finally some statics
+// G) Finally some statics
 // For embedded it is often/typically crucial to reduce overhead,
 // - code footprint (flash memory)
 // - memory footprint (sram memory)
-- 
GitLab