|
楼主
查看: 6985回复: 5
发表于 2019-7-21 11:03:19
只看该作者
使用库函数,编译程序出现下列错误是怎么回事哦?
>> Compilation failure
subdir_rules.mk:9: recipe for target 'main.obj' failed
"../main.c", line 70: warning #225-D: function "ADC10_A_init" declared implicitly
"../main.c", line 70: error #20: identifier "ADC10_A_BASE" is undefined
"../main.c", line 71: error #20: identifier "ADC10_A_SAMPLEHOLDSOURCE_SC" is undefined
"../main.c", line 72: error #20: identifier "ADC10SSEL_0" is undefined
"../main.c", line 73: error #20: identifier "ADC10_A_CLOCKDIVIDER_1" is undefined
"../main.c", line 106: remark #1527-D: (ULP 2.1) Detected SW delay loop using __delay_cycles. Recommend using a timer module instead
4 errors detected in the compilation of "../main.c".
gmake: *** [main.obj] Error 1
gmake: Target 'all' not remade because of errors.
**** Build Finished ****
库函数相关的.h文件路径也设置了的,又发现一部分外设的.h/.c文件可以正常使用(比如GPIO、timer、usci等),调用相关的初始化函数时编译无错误,而另一部分使用时(比如adc10_a.h),调用相关的初始化函数,就出现上面这种函数和标识符未定义的错误。
程序如下:
#include "driverlib.h"
int main (void)
{
//Stop WDT
WDT_A_hold(WDT_A_BASE);
//Set P1.0 to output direction
GPIO_setAsOutputPin(
GPIO_PORT_P1,
GPIO_PIN0
);
ADC10_A_init(ADC10_A_BASE,
ADC10_A_SAMPLEHOLDSOURCE_SC,
ADC10_A_CLOCKSOURCE_ADC10OSC,
ADC10_A_CLOCKDIVIDER_1);
for (;;)
{
__delay_cycles(5000);
// ADC10_A_startConversion(ADC10_A_BASE,
// ADC10_A_SINGLECHANNEL);
__bis_SR_register(CPUOFF + GIE);
__no_operation();
}
}
|
|