while(Ecap1Regs.ECFLG.bit.CEVT1!=1){}
Tst1=Ecap1Regs.CAP1;
while(Ecap1Regs.ECFLG.bit.CEVT2!=1){}
Tst2=Ecap1Regs.CAP2; //检测周期
while(Ecap2Regs.ECFLG.bit.CEVT1!=1){}
Tst3=Ecap2Regs.CAP1;
while(Ecap2Regs.ECFLG.bit.CEVT2!=1){}
Tst4=Ecap2Regs.CAP2; //检测周期;
error #20: identifier "Ecap1Regs" is undefined
error #20: identifier "Ecap2Regs" is undefined
编译时为什么这个会出现未定义呢
我有对ECAP1ECAP2进行初始化了
Yi Su1:
回复 Eric Ma:
我在这个文件里看到了这个
//—————————————-#ifdef __cplusplus#pragma DATA_SECTION("ECap1RegsFile")#else#pragma DATA_SECTION(ECap1Regs,"ECap1RegsFile");#endifvolatile struct ECAP_REGS ECap1Regs;
//—————————————-#ifdef __cplusplus#pragma DATA_SECTION("ECap2RegsFile")#else#pragma DATA_SECTION(ECap2Regs,"ECap2RegsFile");#endifvolatile struct ECAP_REGS ECap2Regs;
原来是我把ECap写成Ecap了.. 谢谢你Eric