0

我正在尝试在 ADC 上使用示例 Atmel 代码。它张贴在这里。 http://asf.atmel.com/docs/latest/sam.drivers.adc.adc_example.sam4s_ek2/html/sam_adc_quickstart.html

但是,代码:

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);
    }
}

产生错误:

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

使用 ASF 向导,我已将 ADC 模块添加到项目中。还有什么我想念的吗?

非常感谢,杰西

4

1 回答 1

1

对于遇到同样错误的任何人:

我发现错误报告http://asf.atmel.com/bugzilla/show_bug.cgi?id=3002

取代:

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);
       }
   }

和:

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);
       }
   }

我想最终示例代码将被更新

于 2013-04-26T13:58:54.340 回答