@@ -98,64 +98,6 @@ pub fn render(
98
98
pub static __INTERRUPTS: [ Vector ; #n] = [
99
99
#( #elements, ) *
100
100
] ;
101
-
102
- /// Macro to override a device specific interrupt handler
103
- ///
104
- /// # Syntax
105
- ///
106
- /// ``` ignore
107
- /// interrupt!(
108
- /// // Name of the interrupt
109
- /// $Name:ident,
110
- ///
111
- /// // Path to the interrupt handler (a function)
112
- /// $handler:path,
113
- ///
114
- /// // Optional, state preserved across invocations of the handler
115
- /// state: $State:ty = $initial_state:expr,
116
- /// );
117
- /// ```
118
- ///
119
- /// Where `$Name` must match the name of one of the variants of the `Interrupt`
120
- /// enum.
121
- ///
122
- /// The handler must have signature `fn()` is no state was associated to it;
123
- /// otherwise its signature must be `fn(&mut $State)`.
124
- #[ cfg( feature = "rt" ) ]
125
- #[ macro_export]
126
- macro_rules! interrupt {
127
- ( $Name : ident, $handler: path, state: $State : ty = $initial_state: expr) => {
128
- #[ allow( unsafe_code) ]
129
- #[ deny( private_no_mangle_fns) ] // raise an error if this item is not accessible
130
- #[ no_mangle]
131
- pub unsafe extern "C" fn $Name ( ) {
132
- static mut STATE : $State = $initial_state;
133
-
134
- // check that this interrupt exists
135
- let _ = $crate :: Interrupt :: $Name ;
136
-
137
- // validate the signature of the user provided handler
138
- let f: fn ( & mut $State ) = $handler;
139
-
140
- f( & mut STATE )
141
- }
142
- } ;
143
-
144
- ( $Name : ident, $handler: path) => {
145
- #[ allow( unsafe_code) ]
146
- #[ deny( private_no_mangle_fns) ] // raise an error if this item is not accessible
147
- #[ no_mangle]
148
- pub unsafe extern "C" fn $Name ( ) {
149
- // check that this interrupt exists
150
- let _ = $crate :: Interrupt :: $Name ;
151
-
152
- // validate the signature of the user provided handler
153
- let f: fn ( ) = $handler;
154
-
155
- f( )
156
- }
157
- } ;
158
- }
159
101
} ) ;
160
102
}
161
103
Target :: Msp430 => {
@@ -309,14 +251,14 @@ pub fn render(
309
251
}
310
252
311
253
if interrupts. len ( ) > 0 {
312
- root. push ( quote ! {
313
- #[ doc( hidden) ]
314
- pub mod interrupt {
315
- #( #mod_items) *
316
- }
317
- } ) ;
318
-
319
254
if * target != Target :: CortexM {
255
+ root. push ( quote ! {
256
+ #[ doc( hidden) ]
257
+ pub mod interrupt {
258
+ #( #mod_items) *
259
+ }
260
+ } ) ;
261
+
320
262
root. push ( quote ! {
321
263
pub use interrupt:: Interrupt ;
322
264
} ) ;
0 commit comments