File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed
Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,11 @@ pub fn device(d: &Device, items: &mut Vec<Tokens>) -> Result<()> {
2828 #![ deny( missing_docs) ]
2929 #![ deny( warnings) ]
3030 #![ allow( non_camel_case_types) ]
31+ #![ feature( asm) ]
32+ #![ feature( core_intrinsics) ]
3133 #![ feature( const_fn) ]
34+ #![ feature( linkage) ]
35+ #![ feature( naked_functions) ]
3236 #![ feature( used) ]
3337 #![ no_std]
3438
@@ -145,9 +149,19 @@ pub fn interrupt(peripherals: &[Peripheral], items: &mut Vec<Tokens>) {
145149 let n = util:: unsuffixed ( u64 ( pos) ) ;
146150 mod_items. push (
147151 quote ! {
148- extern "C" {
149- #( fn #names( ) ; ) *
150- }
152+ #(
153+ #[ allow( non_snake_case) ]
154+ #[ allow( private_no_mangle_fns) ]
155+ #[ linkage = "weak" ]
156+ #[ naked]
157+ #[ no_mangle]
158+ extern "C" fn #names( ) {
159+ unsafe {
160+ asm!( "b DEFAULT_HANDLER" ) ;
161+ :: core:: intrinsics:: unreachable( )
162+ }
163+ }
164+ ) *
151165
152166 #[ doc( hidden) ]
153167 #[ link_section = ".vector_table.interrupts" ]
You can’t perform that action at this time.
0 commit comments