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.

ADC example clearing interrupts

In Starterware 2.0.0.7 for Sitara, in the adc example, adcVoltMeasure.c, there is a function:

/* Clear status of all interrupts */
static void CleanUpInterrupts(void)
{
    TSCADCIntStatusClear(TSC_ADC_INSTANCE, 0x7FF);
    TSCADCIntStatusClear(TSC_ADC_INSTANCE ,0x7FF);
    TSCADCIntStatusClear(TSC_ADC_INSTANCE, 0x7FF);
}

Why is it necessary to do the same instruction 3 times?

I did not see anything in the TRM, DS or errata indicating that this is necessary.

Gerry Belanger

  • Hi Gerard,

    Sorry for the delayed response.

    This is definitely a bug in the example code for ADC, Thanks for pointing this out. You can comment out the extra 2 references to TSCADCIntStatusClear API in the

    CleanUpInterrupts function, calling once the API TSCADCIntStatusClear is sufficient to clear any pending interrupts if any of these bits are set.

    An IR(SDOCM00102637) for this has been raised and this will be fixed in the future release.

    Thanks & Regards

    Anant Pai