From 78976718e7a380656cc04cf00e83861f486083aa Mon Sep 17 00:00:00 2001
From: Emil Kitti <emil.kitti@outlook.com>
Date: Fri, 26 Jan 2018 18:36:23 +0100
Subject: [PATCH] bare0_2

---
 examples/bare0.rs | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/examples/bare0.rs b/examples/bare0.rs
index 80ac35a..4ab8495 100644
--- a/examples/bare0.rs
+++ b/examples/bare0.rs
@@ -6,10 +6,12 @@
 // build without the Rust standard library
 #![no_std]
 
+use core::u32;
+
 // Minimal runtime / startup for Cortex-M microcontrollers
 extern crate cortex_m_rt;
 
-const X_INIT: u32 = 10;
+const X_INIT: u32 = u32::MAX;
 
 static mut X: u32 = X_INIT;
 static mut Y: u32 = 0;
@@ -52,7 +54,16 @@ fn main() {
 //
 // 2. alter the constant X_INIT so that line 22 directly causes the x to wrap
 // 	  what happens when x wraps
-//    ** your answer here **
+//
+//    (gdb) print x
+//    $1 = 4294967295
+//    (gdb) next
+//
+//    Program received signal SIGTRAP, Trace/breakpoint trap.
+//    cortex_m_rt::default_handler (ef=0x20017e68) at /home/kitzin/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-rt-0.3.12/src/lib.rs:454
+//    454	    asm::bkpt();
+//
+//    An interrupt is triggered!
 //
 //    commit your answers (bare0_2)
 //
-- 
GitLab