Skip to content
Snippets Groups Projects
Commit ebf156f6 authored by Samuel Karlsson's avatar Samuel Karlsson
Browse files

bare4: tack 2

parent 24d165e6
Branches
No related tags found
No related merge requests found
No preview for this file type
......@@ -27,8 +27,8 @@ use address::*;
#[inline(always)]
fn read_u32(addr: u32) -> u32 {
unsafe { core::ptr::read_volatile(addr as *const _) }
//core::ptr::read_volatile(addr as *const _)
//unsafe { core::ptr::read_volatile(addr as *const _) }
core::ptr::read_volatile(addr as *const _)
}
#[inline(always)]
......@@ -83,10 +83,13 @@ fn main() {
// 2. comment out line 30 and uncomment line 31 (essentially omitting the `unsafe`)
// what was the error message and explain why,
// ** your answer here **
// call to unsafe function recvier unsafe function or blok
//
// digging a bit deeper, why do you think `read_volatile` is declared `unsafe`
// (https://doc.rust-lang.org/core/ptr/fn.read_volatile.html, for some food for thought )
// ** your answer here **
// it is reading a operation from a perifial. perifials ar critical resorses and writ operations
// kan cas race condition in combination with read.
//
// commit your answers (bare4_2)
//
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment