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.

[参考译文] F29H850TU:如何检测运行时上下文(中断与任务)

Guru**** 2418210 points
Other Parts Discussed in Thread: F29H850TU

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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1540413/f29h850tu-how-to-detect-runtime-context-interrupt-vs-task

器件型号:F29H850TU


工具/软件:

您好、

我需要在运行时确定我的代码是在中断上下文中执行、还是在 F29H850TU 上的任务上下文中执行。 这用于实现上下文感知函数调用。 我的用例如下所示:

if(isInInterrupt()){
    doSomethingFromISR();
}
else{
    doSomething();
}


是否有一个 driverlib API 或一个特定的寄存器可以用来检测上下文?

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

    尊敬的 Hussam:

    如 C29x CPU 参考指南中所示、DSTS.INTS 字段指示存在中断还是主(非中断) 上下文 处于活动状态。  

    更进一步而言、ISTS 寄存器突出显示与中断相关的信息。

    此致、

    Aishwarya