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<()> {
28
28
#![ deny( missing_docs) ]
29
29
#![ deny( warnings) ]
30
30
#![ allow( non_camel_case_types) ]
31
+ #![ feature( asm) ]
32
+ #![ feature( core_intrinsics) ]
31
33
#![ feature( const_fn) ]
34
+ #![ feature( linkage) ]
35
+ #![ feature( naked_functions) ]
32
36
#![ feature( used) ]
33
37
#![ no_std]
34
38
@@ -145,9 +149,19 @@ pub fn interrupt(peripherals: &[Peripheral], items: &mut Vec<Tokens>) {
145
149
let n = util:: unsuffixed ( u64 ( pos) ) ;
146
150
mod_items. push (
147
151
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
+ ) *
151
165
152
166
#[ doc( hidden) ]
153
167
#[ link_section = ".vector_table.interrupts" ]
You can’t perform that action at this time.
0 commit comments