void Uart_Int(void)//串口初始化 { TMOD=0x02;//定时器工作方式2 TH1=0xfd;//波特率设置9600 TL1=0xfd; SCON=0x50;// TR1=1;//定时器开始计时 ES=1;//串口中断打开 EA=1;//总中断打开 } 程序是这样写的,但是出现了,以下错误怎么解决
Build target 'Target 1'
compiling main.c...
MAIN.C(17): error C141: syntax error near 'void'
MAIN.C(18): error C141: syntax error near '{'
MAIN.C(19): error C231: 'TMOD': redefinition
MAIN.C(19): error C231: 'TMOD': redefinition
MAIN.C(20): error C231: 'TH1': redefinition
MAIN.C(20): error C231: 'TH1': redefinition
MAIN.C(21): error C231: 'TL1': redefinition
MAIN.C(21): error C231: 'TL1': redefinition
MAIN.C(22): error C231: 'SCON': redefinition
MAIN.C(22): error C231: 'SCON': redefinition
MAIN.C(23): error C231: 'TR1': redefinition
MAIN.C(23): error C231: 'TR1': redefinition
MAIN.C(24): error C231: 'ES': redefinition
MAIN.C(24): error C231: 'ES': redefinition
MAIN.C(25): error C231: 'EA': redefinition
MAIN.C(25): error C231: 'EA': redefinition
MAIN.C(26): error C141: syntax error near '}'
Target not created
|