From 65f5e2a975b456a28c9e00ff69c6f772c6cbe6f5 Mon Sep 17 00:00:00 2001
From: Josef Utbult <josutb-7@student.ltu.se>
Date: Fri, 5 Mar 2021 15:11:29 +0100
Subject: [PATCH] bare4_1

---
 examples/rtic_bare4.rs | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/examples/rtic_bare4.rs b/examples/rtic_bare4.rs
index 1d53d13..f9f2fe7 100644
--- a/examples/rtic_bare4.rs
+++ b/examples/rtic_bare4.rs
@@ -18,9 +18,9 @@ use stm32f4;
 // Peripheral addresses as constants
 #[rustfmt::skip]
 mod address {
-    pub const PERIPH_BASE: u32      = 0x40000000;
-    pub const AHB1PERIPH_BASE: u32  = PERIPH_BASE + 0x00020000;
-    pub const RCC_BASE: u32         = AHB1PERIPH_BASE + 0x3800;
+    pub const PERIPH_BASE: u32      = 0x40000000;               
+    pub const AHB1PERIPH_BASE: u32  = PERIPH_BASE + 0x00020000; 
+    pub const RCC_BASE: u32         = AHB1PERIPH_BASE + 0x3800; 
     pub const RCC_AHB1ENR: u32      = RCC_BASE + 0x30;
     pub const GBPIA_BASE: u32       = AHB1PERIPH_BASE + 0x0000;
     pub const GPIOA_MODER: u32      = GBPIA_BASE + 0x00;
@@ -33,12 +33,14 @@ use address::*;
 // rcc,     chapter 6
 // gpio,    chapter 8
 
+// Here we have low level access to a bit in a register
 #[inline(always)]
 fn read_u32(addr: u32) -> u32 {
     unsafe { core::ptr::read_volatile(addr as *const _) }
     // core::ptr::read_volatile(addr as *const _)
 }
 
+// Here we have low level access to a bit in a register
 #[inline(always)]
 fn write_u32(addr: u32, val: u32) {
     unsafe {
@@ -83,7 +85,7 @@ const APP: () = {
 //
 // 1.  Did you enjoy the blinking?
 //
-//    ** your answer here **
+//      I prefere longer intervals in my blinking, but it was quite pleasant.
 //
 //    Now lookup the data-sheets, and read each section referred,
 //    6.3.11, 8.4.1, 8.4.7
-- 
GitLab