Search code examples
cmicrocontrolleratmeladc

request for member 'isr_status' in something not a structure or union


I am trying to use an example Atmel code on ADCs. It is posted here. http://asf.atmel.com/docs/latest/sam.drivers.adc.adc_example.sam4s_ek2/html/sam_adc_quickstart.html

However, the code:

void ADC_IrqHandler(void)
{
    // Check the ADC conversion status
    if ((adc_get_status(ADC).isr_status & ADC_ISR_DRDY) ==   ADC_ISR_DRDY)
    {
        // Get latest digital data value from ADC and can be used by application
        uint32_t result = adc_get_latest_value(ADC);
    }
}

produces the error:

request for member 'isr_status' in something not a structure or union

using the ASF wizard I have added the ADC modules to the project. Is there something else I am missing?

Much appreciated, Jesse


Solution

  • For anyone who gets this same error:

    I found bug report http://asf.atmel.com/bugzilla/show_bug.cgi?id=3002

    which replaces:

    void ADC_IrqHandler(void)
       {
           //Check the ADC conversion status 
           if ((adc_get_status(ADC).isr_status & ADC_ISR_DRDY) ==   ADC_ISR_DRDY)
           {
           //Get latest digital data value from ADC and can be used by application
               uint32_t result = adc_get_latest_value(ADC);
           }
       }
    

    with:

    void ADC_IrqHandler(void)
       {
           //Check the ADC conversion status 
           if (adc_get_status(ADC) & ADC_ISR_DRDY) 
           {
           //Get latest digital data value from ADC and can be used by application
               uint32_t result = adc_get_latest_value(ADC);
           }
       }
    

    I guess eventually the example code will be updated