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.

[参考译文] 针对 CM 内核 C 的 ISR 处理程序的正确同步

Guru**** 2394075 points
Other Parts Discussed in Thread: C2000WARE

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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1065405/correct-syntaxis-of-isr-handlers-for-cm-core-c

器件型号:TMS320F28384S
主题中讨论的其他器件:C2000WARE

大家好、我不熟悉 CM 内核编程。  

您能解释一下如何在 C 语言中正确写入中断处理程序吗

我以前一直在 C28x 和其他架构上使用"_interrupt"关键字。 但在 C2000ware 文件夹 f2838x/cm 中、有一些示例、其中 ISR 处理程序中未使用_interrupt 关键字。

例如、在 SysTK_ex1_interrupt.c 中:

空 sysTickHandler (void)、不带_interrupt 关键字。

但是在"timer_ex1_cputimers.c"中、有一些普通的 ISR 处理程序:

_interrupt void cpuTimer0ISR。

此外、在"mCAN_ex1_loopback.c"示例中、ISR 处理程序具有"静态空"头文件。  

那么、是否有必要使用__interrupt 关键字或 pragma?它的规则是什么?  

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

    您好!

    [引用 userid="255945" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/C2000-microcontrollers-forume/1065405/correct-synturs-of ISR-handlers-for-cm-core-c"]_interrupt 关键字或 pragma、其规则是什么?  [/报价]

    这适用于 C28x 代码。 对于 CM、不需要__interrupt 关键字。

    此致、

    Vivek Singh