diff options
Diffstat (limited to 'cortex-m-rt/examples/pre_init.rs')
-rw-r--r-- | cortex-m-rt/examples/pre_init.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/cortex-m-rt/examples/pre_init.rs b/cortex-m-rt/examples/pre_init.rs new file mode 100644 index 0000000..2c931bb --- /dev/null +++ b/cortex-m-rt/examples/pre_init.rs @@ -0,0 +1,20 @@ +//! `cortex-m-rt` based program with a function run before RAM is initialized. + +#![deny(warnings)] +#![no_main] +#![no_std] + +extern crate cortex_m_rt as rt; +extern crate panic_halt; + +use rt::{entry, pre_init}; + +#[pre_init] +unsafe fn disable_watchdog() { + // Do what you need to disable the watchdog. +} + +#[entry] +fn main() -> ! { + loop {} +} |