diff --git a/examples/rtic_bare4.rs b/examples/rtic_bare4.rs index 1d53d13715b0afe372d3ab430e5fe1c301fb740a..f9f2fe77571cf05ffdf06a0cbc8a6772d166a889 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