From 4a3c6caec90d98327e90d45b74e9a3159994344c Mon Sep 17 00:00:00 2001
From: anttib-5 <anttib-5@student.ltu.se>
Date: Wed, 13 Mar 2019 15:32:45 +0100
Subject: [PATCH] bare10_1

---
 TestITM            | 32 +++++++++++++++-----------------
 examples/bare10.rs | 15 ++++++++-------
 2 files changed, 23 insertions(+), 24 deletions(-)

diff --git a/TestITM b/TestITM
index 943735b..9218b20 100644
--- a/TestITM
+++ b/TestITM
@@ -1,17 +1,15 @@
-Ok 97
-Ok 471
-Error 83
-Error Overrun
-Ok 471
-Error 84
-bare9
-goto sleep
-woken..
-data 97
-goto sleep
-woken..
-data 13
-goto sleep
-woken..
-data 97
-goto sleep
+data 97
+UsartReceiveOverflow
+data 13
+data 97
+UsartReceiveOverflow
+data 97
+UsartReceiveOverflow
+data 97
+UsartReceiveOverflow
+data 100
+RingBufferOverflow
+data 115
+RingBufferOverflow
+data 13
+UsartReceiveOverflow
diff --git a/examples/bare10.rs b/examples/bare10.rs
index 5d3882e..2810445 100644
--- a/examples/bare10.rs
+++ b/examples/bare10.rs
@@ -83,10 +83,10 @@ const APP: () = {
     fn trace_data(byte: u8) {
         let stim = &mut resources.ITM.stim[0];
         iprintln!(stim, "data {}", byte);
-        // for _ in 0..10000 {
-        //     asm::nop();
-        // }
-    }
+        for _ in 0..10000 {
+             asm::nop();
+        }
+    } 
 
     #[task(priority = 1, resources = [ITM])]
     fn trace_error(error: Error) {
@@ -145,15 +145,16 @@ const APP: () = {
 //
 //    Did you loose any data (was the data correctly echoed)?
 //
-//    ** your answer here **
+//    Yes
 //
 //    Was the data correctly traced over the ITM?
 //
-//    ** your answer here **
+//    No, it got usartrecieveoverflow
 //
 //    Why did you loose trace information?
 //
-//    ** your asnwer here **
+//    It was because of the loop that is implemented in the trace function.
+//    When the loop has been implemented, the function will be called again when it already is doing some work.
 //
 //    Commit your answers (bare10_1)
 //
-- 
GitLab