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/EVM430-FR6047: Handle Interruption's Vector

Part Number: EVM430-FR6047

Tool/software: Code Composer Studio

Hi,

I'm setting up RTC_C on chipset, and have a question about handling its interruptions.

#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=RTC_C_VECTOR
__interrupt void RTC_C_Interrupt(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(RTC_C_VECTOR))) RTC_C_Interrupt (void)
#else
#error Compiler not supported!
#endif
{
    // Handle Interruptions sources
    // RTC_C_TIME_EVENT_INTERRUPT
    // RTC_C_CLOCK_ALARM_INTERRUPT
    // RTC_C_PRESCALE_TIMER1_INTERRUPT
}

How do I handle each interruption?

Do I check for all cases separately all in one call (bunch of separated IF), or handle one first, and if there are some other interruption pending, it will call RTC_C_Interrupt() again automatically?

Thanks.

  • Typically, you'd read the interrupt source from the RTC's interrupt vector register (which automatically clears the flag):

    switch (RTCIV) {
    case RTCIV__RTCTEVIFG:
        // ...
        break;
    case RTCIV__RTCAIFG:
        // ...
        break;
    case RTCIV__RT1PSIFG:
        // ...
        break;
    case RTCIV__NONE:
    case RTCIV__RTCOFIFG:
    case RTCIV__RTCRDYIFG:
    case RTCIV__RT0PSIFG:
    default:
        break;
    }

    As long as any other interrupt is pending, the handler will be called again automatically.

  • Thanks, it worked!

**Attention** This is a public forum