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.

[参考译文] TMS320F28062F:ADC 中断和 CAN 中断的嵌套

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

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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1314728/tms320f28062f-nesting-of-adc-interrupts-and-can-interrupts

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

我在电机控制工程中同时使用了 CAN 接收中断(INT9.5)和 ADC 中断(INT1.1)。 如果在 CAN 中断执行期间发生、我现在想对 ADC 中断执行进行优先级排序、但是没能做到。

interrupt void WL_CAN_RX_ISR(void)
{
    volatile uint16_t TempPIEIER = halHandle->pieHandle->PIEIER_PIEIFR[8].IER;
    IER |= 0x0001;
    IER &= 0x0001;
    halHandle->pieHandle->PIEIER_PIEIFR[0].IER &= 0x0001;
    halHandle->pieHandle->PIEACK = 0xFFFF;
    EINT;
    WEILANCANRx();
    HAL_acqEcanInt(halHandle);
    DINT;
    halHandle->pieHandle->PIEIER_PIEIFR[8].IER = TempPIEIER;
}

static inline void HAL_acqEcanInt(HAL_Handle handle)
{
    HAL_Obj *obj = (HAL_Obj *)handle;
    Ecan_clearIntFlag(obj->canHandle);
    PIE_clearInt(obj->pieHandle,PIE_GroupNumber_9);
}

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

    您好!

    请查看" 软件优先级中断示例 " C2000Ware\device_support\f2806x\examples\c28\sw_priorited_interrupts 文件夹中的 C2000Ware SDK 中的示例、了解有关中断优先级的更多详细信息。

    谢谢

    阿斯温