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.

[参考译文] TMS320F280025C:标记"__interrupt"用于声明中断

Guru**** 2540720 points


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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1057163/tms320f280025c-signification-__interrupt-to-declare-an-interrupt

器件型号:TMS320F280025C

您好!

在这里、我的代码正常运行、但"_interrupt"会如何   取消中断、因为 当我不这么声明中断时、我的中断不起作用。 当 在  每个循环转动时缺少_interrupt 时、"ADC_INDEX = 0"、因此我的缓冲区未完成。  

__interrupt void isr_adc(void)
{
    // Record ADC value
    Vout_samples[Adc_index] = ADC_readResult(VOUT_ADCRESULTREGBASE, VOUT_ADC_SOC_NO);
    Adc_index++;

    if(Adc_index >= SAMPLES)
    {
        Adc_index = 0;
        adc_bufferfull = 1;
    }

    ADC_clearInterruptStatus(ADCC_BASE, VOUT_ADC_INT_NUMBER);                                                       // Clear the interrupt flag

    if(ADC_getInterruptOverflowStatus(ADCC_BASE, VOUT_ADC_INT_NUMBER) == true)                                      // Check if overflow has occurred
    {
        ADC_clearInterruptOverflowStatus(ADCC_BASE, VOUT_ADC_INT_NUMBER);
        ADC_clearInterruptStatus(ADCC_BASE, VOUT_ADC_INT_NUMBER);
    }

    Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP1);                                                              // Acknowledge the interrupt
}

对于我来说、中断映射由"Interrupt_register (INT_ADCC1、&ISR_ADC);"进行。 还有其他的吗?

谢谢、

Damien

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

    尊敬的 Damien:

    所有 ISR 函数都需要__interrupt 属性。 这是因为 寄存器保存/恢复和返回序列在 ISR 函数中与正常函数不同。

    您可以查看 文档以了解更多详细信息。

    此致、

    Veena

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

    您好、Veena、

    好的、谢谢您、我将查看此文档。

    Damien