文件一: #include <Reg52.h> #include <math.h> #include <intrins.h> #include "Def.H"
unsigned char idata reset0 _at_ 0x7e; unsigned char idata reset1 _at_ 0x7F; unsigned char xdata Addr273 _at_ 0x0300;
extern void DelayMs(); extern void Handle();
void main(void) { unsigned char Cnt; U8 Timer; Cnt=Timer=0; reset0=reset1=0x0F; P0=0xFF; P1=0xFF; P2=0xFF; P3=0xFF;
while(1) { Handle(Timer); ++Timer; DelayMs(1000); }
} 文件二: extern Addr273;
char Handle(char i) { Addr273=i; } 文件三: extern void DelayUs();
void DelayMs(unsigned int i) { while(--i) { DelayUs(998); } } 文件四: void DelayUs(unsigned int i)//T=i+2 { while(--i); }
编译结果如下: Build target 'Target 1' assembling STARTUP.A51... compiling Main.c... DELAY1.C(7): error C267: 'DelayUs': requires ANSI-style prototype MAIN.C(9): error C231: 'Addr273': redefinition compiling EXdrive.c... EXDRIVE.C(6): warning C173: missing return-expression 6+>ph . compiling Delay1.c... DELAY1.C(7): error C267: 'DelayUs': requires ANSI-style prototype compiling Delay2.c... Target not created
我不想把文件和并,但是怎么编译老是出问题,请问怎么处理?谢谢
|