#ifndef TFT_H
#define TFT_H
sbit TFT_RS = P2^0;
sbit TFT_WR = P2^1;
sbit TFT_CS = P2^2;
#define TFT_Data P0
//---TFT寄存器定义---
//#define I 3fh
//#define J 40h
//#define K 41h
#define VH 42h
#define VL 43h
#define colorH 44h
#define colorL 45h
void TFT_Write_Bus();
void Address_set();
void paint();
void ignu2(uint color);
//-----
void TFT_Write_Bus(){//发送数据给TFT, 输入VH, VL. 先发低位后高位
TFT_Data=VL;
TFT_WR=0;
TFT_CS=1;
TFT_CS=0;
TFT_WR=1;
TFT_Data=VH;
TFT_WR=0;
TFT_CS=1;
TFT_CS=0;
TFT_WR=1;
}
void Address_set(){//TFT初始化
VH=0;
VL=0;
TFT_RS=0;
TFT_CS=0;
TFT_Write_Bus(); //x起始地址
VH=0;
VL=0;
TFT_Write_Bus(); //y起始地址
}
void paint(){
uchar i,k;
TFT_CS=0;
Address_set();
TFT_RS=1;
VH=colorH;
VL=colorL;
for(k=0;k<160;k++)
for(i=0;i<240;i++){
TFT_Write_Bus();
TFT_Write_Bus();
}
TFT_CS=1;
}
void ignu2(uint colortmp){
colorH=0x0;
colorL=0x0;
paint();
}
#endif
报错如下:
Build target '目标 1'
compiling G.c...
TFT.H(24): error C141: syntax error near 'h'
TFT.H(24): error C202: 'h': undefined iden
tifier
TFT.H(30): error C141: syntax error near 'h'
TFT.H(30): error C202: 'h': undefined identifier
TFT.H(37): error C141: syntax error near 'h'
TFT.H(37): error C202: 'h': undefined identifier
TFT.H(38): error C141: syntax error near 'h'
TFT.H(38): error C202: 'h': undefined identifier
TFT.H(42): error C141: syntax error near 'h'
TFT.H(42): error C202: 'h': undefined identifier
TFT.H(43): error C141: syntax error near 'h'
TFT.H(43): error C202: 'h': undefined identifier
TFT.H(52): error C141: syntax error near 'h'
TFT.H(52): error C202: 'h': undefined identifier
TFT.H(52): error C141: syntax error near 'h'
TFT.H(53): error C141: syntax error near 'h'
TFT.H(53): error C202: 'h': undefined identifier
TFT.H(53): error C141: syntax error near 'h'
TFT.H(63): error C141: syntax error near 'h'
TFT.H(63): error C202: 'h': undefined identifier
TFT.H(64): error C141: syntax error near 'h'
TFT.H(64): error C202: 'h': undefined identifier
这是什么意思呢?'h'哪来的???求高手求解谢谢~!
一周热门 更多>