I'm trying to trigger and sample ADC values inside an interrupt handler but it always gets stuck inside the while loop waiting on ADCIntStatus.
// Trigger the ADC conversion.
ADCProcessorTrigger(ADC1_BASE, ADC_SEQ_0);
// Wait for conversion to be completed.
while(!ADCIntStatus(ADC1_BASE, ADC_SEQ_0, false))
{
}
// Clear the ADC interrupt flag.
ADCIntClear(ADC1_BASE, ADC_SEQ_0);
// Read ADC Value.
ADCSequenceDataGet(ADC1_BASE, ADC_SEQ_0, &pVID[3]);
This seems to work for me outside of an interrupt handler but I need to sample the values upon an interrupt. Is there something I'm missing. I can't imagine this isn't possible. It seems to get hung up in or because of the while loop but only when placed inside my ISR. I place it anywhere else and everything runs. Inside the ISR it gets stuck. ????
// Wait for conversion to be completed.uint32_t ui32ADCIntStatus;ui32ADCIntStatus= ADCIntStatus(ADC1_BASE, ADC_SEQ_0,true);// Read ADC Value.ADCSequenceDataGet(ADC1_BASE, ADC_SEQ_0, &pVID[3]);// Set a Global flag
ui32ADCConversionComplete = 1;// Clear the ADC interrupt flag.ADCIntClear(ADC1_BASE, ADC_SEQ_0);