aboutsummaryrefslogtreecommitdiff
path: root/cortex-m-rt/examples/entry-static.rs
blob: 55e7a89ecf9c979a54649e0ebefcb22bd4158b02 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//! `static mut` variables local to the entry point are safe to use

#![deny(unsafe_code)]
#![deny(warnings)]
#![no_main]
#![no_std]

extern crate cortex_m_rt as rt;
extern crate panic_halt;

use rt::entry;

#[entry]
fn main() -> ! {
    static mut COUNT: u32 = 0;

    loop {
        *COUNT += 1;
    }
}