Skip to content

Commit 7e34184

Browse files
[MSP430] User defined interrupt handlers should have correct CC.
1 parent a69765c commit 7e34184

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/generate.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,10 @@ pub fn interrupt(
313313
});
314314

315315
if *target != Target::None {
316+
let abi = match *target {
317+
Target::Msp430 => "msp430-interrupt",
318+
_ => "C",
319+
};
316320
mod_items.push(quote! {
317321
#[cfg(feature = "rt")]
318322
#[macro_export]
@@ -331,7 +335,7 @@ pub fn interrupt(
331335

332336
#[allow(non_snake_case)]
333337
#[no_mangle]
334-
pub extern "C" fn $NAME() {
338+
pub extern #abi fn $NAME() {
335339
// check that the handler exists
336340
let _ = $crate::interrupt::Interrupt::$NAME;
337341

@@ -350,7 +354,7 @@ pub fn interrupt(
350354
($NAME:ident, $path:path) => {
351355
#[allow(non_snake_case)]
352356
#[no_mangle]
353-
pub extern "C" fn $NAME() {
357+
pub extern #abi fn $NAME() {
354358
// check that the handler exists
355359
let _ = $crate::interrupt::Interrupt::$NAME;
356360

0 commit comments

Comments
 (0)