我正在尝试在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模块添加到项目中。还有其他我想念的东西吗?
非常感激,
杰西
最佳答案
对于遇到相同错误的任何人:
我发现错误报告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);
}
}
我想最终示例代码将被更新
关于c - 在非结构或 union 中请求成员“isr_status”,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/16238133/