File tree Expand file tree Collapse file tree 2 files changed +34
-2
lines changed Expand file tree Collapse file tree 2 files changed +34
-2
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,35 @@ pub fn render(
125
125
] ;
126
126
} ) ;
127
127
}
128
- Target :: RISCV => { }
128
+ Target :: RISCV => {
129
+ for name in & names {
130
+ writeln ! (
131
+ device_x,
132
+ "PROVIDE({} = DefaultExternalInterruptHandler);" ,
133
+ name
134
+ ) ?;
135
+ }
136
+
137
+ root. extend ( quote ! {
138
+ #[ cfg( feature = "rt" ) ]
139
+ extern "C" {
140
+ #( fn #names( ) ; ) *
141
+ }
142
+
143
+ #[ doc( hidden) ]
144
+ pub union Vector {
145
+ pub _handler: unsafe extern "C" fn ( ) ,
146
+ pub _reserved: usize ,
147
+ }
148
+
149
+ #[ cfg( feature = "rt" ) ]
150
+ #[ doc( hidden) ]
151
+ #[ no_mangle]
152
+ pub static __EXTERNAL_INTERRUPTS: [ Vector ; #n] = [
153
+ #elements
154
+ ] ;
155
+ } ) ;
156
+ }
129
157
Target :: XtensaLX => {
130
158
for name in & names {
131
159
writeln ! ( device_x, "PROVIDE({} = DefaultHandler);" , name) ?;
Original file line number Diff line number Diff line change @@ -160,7 +160,11 @@ fn run() -> Result<()> {
160
160
file. write_all ( data. as_ref ( ) )
161
161
. expect ( "Could not write code to lib.rs" ) ;
162
162
163
- if target == Target :: CortexM || target == Target :: Msp430 || target == Target :: XtensaLX {
163
+ if target == Target :: CortexM
164
+ || target == Target :: Msp430
165
+ || target == Target :: XtensaLX
166
+ || target == Target :: RISCV
167
+ {
164
168
writeln ! ( File :: create( path. join( "device.x" ) ) ?, "{}" , device_x) ?;
165
169
writeln ! ( File :: create( path. join( "build.rs" ) ) ?, "{}" , build_rs( ) ) ?;
166
170
}
You can’t perform that action at this time.
0 commit comments