aboutsummaryrefslogtreecommitdiff
path: root/cortex-m-rt/examples/pre_init.rs
blob: 7258936fae6800e8460aa4d1246ea34e3480964f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//! `cortex-m-rt` based program with a function run before RAM is initialized.

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

#[macro_use(entry, pre_init)]
extern crate cortex_m_rt as rt;
extern crate panic_semihosting;

pre_init!(disable_watchdog);

unsafe fn disable_watchdog() {
    // Do what you need to disable the watchdog.
}

// the program entry point
entry!(main);

fn main() -> ! {
    loop {}
}