switch.c(51): error C141: syntax error near 'void'啊啊啊,这里不知道咋回事了
#include<reg51.h>#include<intrins.h>
#define uchar unsigned char
#define uint unsigned int
sbit S1=P1^0;
sbit S2=P1^1;
uchar code seg[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};//¹²ÑôLEDÊýÂë¹Ü¶ÎÂë±í
void plus(void);//º¯Êýµ÷ÓÃÉùÃ÷
void minus(void);
void key_scan(void);
uchar keyval;
void delay(uint t) //ÑÓʱº¯Êý
{
uchar j;
while(t --)
for(j=0;j<200;j++);
}
void main() //Ö÷º¯Êý
{
while(1)
key_scan();
switch(keyval)//ÅжÏp1¿ÚµÍÁ½Î»µÄ״̬
{
case 0:
break;
case 2: plus();
break;
case 1: minus();
break;
case 3:
break;
}
}
void plus(void) //ÕýÏòÑ­»·º¯Êý
{
uchar i;
while(1)
{
for(i=0;i<10;i++)
{
P0=seg[i];
delay(700);
if(seg[i]==0x90)
i=0;
}
}
void minus(void) //·´ÏòÑ­»·º¯Êý
{
uchar i;
while(1)