Skip to content
Snippets Groups Projects
Commit b33651f3 authored by Ridge's avatar Ridge
Browse files

bare0_2

parent 31091945
No related branches found
No related tags found
No related merge requests found
Pipeline #121 canceled
......@@ -19,7 +19,7 @@ extern crate panic_halt;
use cortex_m_rt::entry;
// a constant (cannot be changed at run-time)
const X_INIT: u32 = 10;
const X_INIT: u32 = u32::max_value();
// global mutabale variables (changed using unsafe code)
static mut X: u32 = X_INIT;
......@@ -67,7 +67,7 @@ fn main() -> ! {
// 2. Alter the constant X_INIT so that `x += 1` directly causes `x` to wrap
// what happens when `x` wraps
//
// ** your answer here **
// It causes a core panic.
//
// Commit your answers (bare0_2)
//
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment