@@ -23,19 +23,23 @@ pub fn device(d: &Device, items: &mut Vec<Tokens>) -> Result<()> {
2323 ) ;
2424 items. push (
2525 quote ! {
26+ #![ cfg_attr( feature = "rt" , feature( asm) ) ]
27+ #![ cfg_attr( feature = "rt" , feature( core_intrinsics) ) ]
28+ #![ cfg_attr( feature = "rt" , feature( linkage) ) ]
29+ #![ cfg_attr( feature = "rt" , feature( macro_reexport) ) ]
30+ #![ cfg_attr( feature = "rt" , feature( naked_functions) ) ]
31+ #![ cfg_attr( feature = "rt" , feature( used) ) ]
2632 #![ doc = #doc]
2733 #![ deny( missing_docs) ]
2834 #![ deny( warnings) ]
2935 #![ allow( non_camel_case_types) ]
30- #![ feature( asm) ]
31- #![ feature( core_intrinsics) ]
3236 #![ feature( const_fn) ]
33- #![ feature( linkage) ]
34- #![ feature( naked_functions) ]
35- #![ feature( used) ]
3637 #![ no_std]
3738
3839 extern crate cortex_m;
40+ #[ macro_reexport( default_handler, exception) ]
41+ #[ cfg( feature = "rt" ) ]
42+ extern crate cortex_m_rt;
3943 extern crate vcell;
4044
4145 use core:: ops:: Deref ;
@@ -149,6 +153,7 @@ pub fn interrupt(peripherals: &[Peripheral], items: &mut Vec<Tokens>) {
149153 #(
150154 #[ allow( non_snake_case) ]
151155 #[ allow( private_no_mangle_fns) ]
156+ #[ cfg( feature = "rt" ) ]
152157 #[ linkage = "weak" ]
153158 #[ naked]
154159 #[ no_mangle]
@@ -160,10 +165,13 @@ pub fn interrupt(peripherals: &[Peripheral], items: &mut Vec<Tokens>) {
160165 }
161166 ) *
162167
168+ #[ allow( private_no_mangle_statics) ]
169+ #[ cfg( feature = "rt" ) ]
170+ #[ doc( hidden) ]
163171 #[ link_section = ".vector_table.interrupts" ]
164172 #[ no_mangle]
165173 #[ used]
166- static INTERRUPTS : [ Option <extern "C" fn ( ) >; #n] = [
174+ pub static INTERRUPTS : [ Option <extern "C" fn ( ) >; #n] = [
167175 #( #elements, ) *
168176 ] ;
169177
@@ -181,6 +189,7 @@ pub fn interrupt(peripherals: &[Peripheral], items: &mut Vec<Tokens>) {
181189 }
182190 }
183191
192+ #[ cfg( feature = "rt" ) ]
184193 #[ macro_export]
185194 macro_rules! interrupt {
186195 ( $NAME : ident, $f: ident, local: {
@@ -232,7 +241,9 @@ pub fn interrupt(peripherals: &[Peripheral], items: &mut Vec<Tokens>) {
232241 if interrupts. len ( ) > 0 {
233242 items. push (
234243 quote ! {
235- /// Interrupts
244+ pub use interrupt:: Interrupt ;
245+
246+ #[ doc( hidden) ]
236247 pub mod interrupt {
237248 #( #mod_items) *
238249 }
0 commit comments