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
|