This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CCS/MSP430G2452:#pragma vector=unused_interrupts 不起作用

Guru**** 3040470 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/871448/ccs-msp430g2452-pragma-vector-unused_interrupts-not-working

器件型号:MSP430G2452

工具/软件:Code Composer Studio

看起来未使用的中断 pragma 不起作用。

#pragma vector=unused_interrupts
__interrupt void error_isr (void)
{
while (1);
}

编译后、我会收到警告:

警告#179-D:函数"error_isr"已声明但从未引用

未使用的 Port1中断的映射文件显示:

端口1 0 0000f7e4 00000002
0000f7e4 00000002 rts430_eabi.lib:int02.asm.obj (.int02)

编译器:TI v18.13.3.LTS

有什么想法吗?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我无法重现此行为...

    [引用用户="Gennadiy Kiryukhin"]

    编译后、我会收到警告:

    警告#179-D:函数"error_isr"已声明但从未引用

    [/报价]

    对于获得此诊断的源文件、请按照文章 如何提交编译器测试用例中的说明进行操作。

    谢谢、此致、

    乔治

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    事实上、我将中断函数原型声明为静态 void  error_isr(void).

    在迁移代码的过程中、它被忽略、而不会被删除。 这是在不发出重新声明警告的情况下关闭编译器。