File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ //! `cortex-m-rt` based program with a function run before RAM is initialized.
2
+
3
+ #![ deny( warnings) ]
4
+ #![ no_main]
5
+ #![ no_std]
6
+
7
+ #[ macro_use( entry, exception, pre_init) ]
8
+ extern crate cortex_m_rt as rt;
9
+ extern crate panic_semihosting;
10
+
11
+ use rt:: ExceptionFrame ;
12
+
13
+ pre_init ! ( disable_watchdog) ;
14
+
15
+ unsafe fn disable_watchdog ( ) {
16
+ // Do what you need to disable the watchdog.
17
+ }
18
+
19
+ // the program entry point
20
+ entry ! ( main) ;
21
+
22
+ fn main ( ) -> ! {
23
+ loop { }
24
+ }
25
+
26
+ // the hard fault handler
27
+ exception ! ( HardFault , hard_fault) ;
28
+
29
+ fn hard_fault ( _ef : & ExceptionFrame ) -> ! {
30
+ loop { }
31
+ }
32
+
33
+ // the default exception handler
34
+ exception ! ( * , default_handler) ;
35
+
36
+ fn default_handler ( _irqn : i16 ) { }
You can’t perform that action at this time.
0 commit comments