这又是什么鬼错了
#include <reg51.h> #define uint8 unsigned char
#define uint16 unsigned int
#define TIMER0_HIGHT0xDC
#define TIMER0_LOW 0x00
sbit keyin=P3^1;
bit starttest;
uint16 cnt10ms; //10ms计数器 这行改了,怎么还错,是显示这里错啊,为嘛改了不得,
uint8 cnt1s;
uint8 Pulsecnt;
uint8 Pulsenum;
uint8 codeDispCode[]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0X80,0X90};
void Init_Extint(void);
void TimerInitProc();
void initvar();
void Init_Sustem(void);
void Display(uint8 chose_dat,uint8 dat);
void ShowDisp(uint8 tPulsenum,uint8 tPulsecnt,uint8 tcntls);
void DelayMs(uint8 Ms);
void main()
{
Init_System();
while(1)
{
ShowDisp(Pulsenum,Pulsencnt,cntls);
}
}
/*************************************
***********/
void Ext0_interrupt(void)interrupt0
{
if(starttest==1)
{
Pulsencnt++;
}
}
void Timer0IntProc()interrupt1
{
TH0=TIMER0_HIGHT;
TL0=TLMER0_LOW;
if(++cnt10ms==100)
{
cnt10ms=0;
if(starttest==1)
{
if(++cnt1s==60)
{
starttest=0;
Pulsenum=Pulsecnt;
}
}
}
if(keyin==0)
{
if(starttest==1)
{
cnt10ms=0;
cnt1s=0;
Pulsecnt=0;
}
else
{
starttest=1;
cnt10ms=0;
}
}
}
void Init_Extint(voi)
{
IT0=1;
IE0=0;
EX0=1;
}
void TimerInitProc()
{
TMOD &=0xF0;
TMOD |=0X01;
TH0=TIMER0_HIGHT;
TL0=TMER0_LOW;
TR0=1;
ET0=1;
EA=1;
}
void initvar()
{
starttest=0;
vnt10ms=0;
vnt1s=0;
Pulsecnt=0;
Pulsenum=0;
}
void Init_System(void)
{
Init_Extint();
TimerInitProc();
initvar();
}
void Display(uint8 chose_dat,uint8 dat)
{
P0=dat;
P2=~(0x01<<chose_dat);
DelayMs(1);
P2=0xFF;
}
void ShowDisp(uint8 tPulsenum, uint8 tPulsecnt,uint8 tcntls)
{
Display(6,DispCode[tPulsenum%10]);
tPulsenum=tPulsenum/10;
Display(7,DispCode[tPulsenum%10]);
Display(3,DispCode[tPulsecnt%10]);
tPulsecnt=tPulsecnt/10;
Display(4,DispCode[tPulsecnt%10]);
Display(0,DispCode[tcntls%10]);
tcntls=tcntls/10;
Display(1,DispCode[tcntls%10]);
}
void DelayMs(uint8 Ms)
{
unsigned char i,j;
do
{
for(i=5;i>0l;i--)
for(j=98;j>0;j--);
}while(--Ms);
//Test for 12M
}
/////////////////////adsf////////////////
下面错怎么多,真是
Build target 'Target 1'
compiling main.c...
MAIN.C(22): warning C206: 'Init_System': missing function-prototype
MAIN.C(25): error C202: 'Pulsencnt': undefined identifier
MAIN.C(31): error C132: 'interrupt0': not in formal parameter list
MAIN.C(31): error C141: syntax error near '{'
MAIN.C(34): error C132: 'Pulsencnt': not in formal parameter list
MAIN.C(37): error C132: 'Timer0IntProc': not in formal parameter list
MAIN.C(37): error C141: syntax error near 'interrupt1'
MAIN.C(38): error C132: 'interrupt1': not in formal parameter list
MAIN.C(39): error C244: 'TH0': can't initialize, bad type or class
MAIN.C(39): error C202: 'TIMER0_HIGHT': undefined identifier
MAIN.C(39): error C132: 'TH0': not in formal parameter list
MAIN.C(40): error C244: 'TL0': can't initialize, bad type or class
MAIN.C(40): error C202: 'TLMER0_LOW': undefined identifier
MAIN.C(40): error C132: 'TL0': not in formal parameter list
MAIN.C(41): error C141: syntax error near 'if'
MAIN.C(41): error C141: syntax error near '++'
MAIN.C(41): error C129: missing ';' before '=='
Target not created