Select Git revision
bare0.rs 663 B
//! bare0.rs
//! Simple bare metal application
// feature to ensure symbols to be linked
#![feature(used)]
// build without the Rust standard library
#![no_std]
// Minimal runtime / startup for Cortex-M microcontrollers
extern crate cortex_m_rt;
static mut X: u32 = 10;
fn main() {
let mut x = unsafe { X };
loop {
x += 1;
unsafe {
X += 1;
assert!(x == X);
}
}
}
// As we are not using interrupts, we just register a dummy catch all handler
#[link_section = ".vector_table.interrupts"]
#[used]
static INTERRUPTS: [extern "C" fn(); 240] = [default_handler; 240];
extern "C" fn default_handler() {}