久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 3895|回復: 2
打印 上一主題 下一主題
收起左側

KEIL程序編譯提示未定義error C267: 'read': requires ANSI-style prototype

[復制鏈接]
跳轉到指定樓層
樓主
ID:447439 發表于 2022-1-13 22:08 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
10黑幣
程序編譯提示未定義,折騰一天了,實在頭疼。麻煩幫忙看下。
標紅的代碼是提示出錯的點!

void write(bit flag,uchar dat) //flag=0,write command;flag=1,write data
{
uchar i;
cd=flag; //flag=1,write command;flag=0,write data
cs = 0;
for(i = 0; i < 8; i++)
{
sda = dat & 0x80 ;
dat <<= 1 ;
sck = 1 ;
sck = 0 ;
        }

        cs = 1;

}

void init(void) //this subprogram is very important,please reference P50 of uc1698 datasheet
{
cs=0;

        /*************************reset*************************/
rst=0;
delay_ms(2); //reset
rst=1;
delay_ms(200);
write(0,0xe2); //24:reset by command
delay_ms(2);

        /**********************power control*********************/
write(0,0xe9); //27:Bias Ratio:1/10 bias
write(0,0x2b); //6:power control set as internal power
write(0,0x24); //5:set temperate compensation as 0%
write(0,0x81); //11:electronic potentionmeter
write(0,198);

        /**********************display control*******************/
write(0,0xa4); //16:all pixel off
write(0,0xa6); //17:inverse display off

/*************************lcd control********************/
write(0,0xc0); //19:partial display and MX disable,MY enable
write(0,0xa3); //15:line rate 15.2klps
write(0,0xd1); //21:rgb-rgb
write(0,0xd5); //18:4k color mode
write(0,0x84); //12:partial display control disable

/********************n-line inversion********************/
write(0,0xc8); //20,set n-line inversion
write(0,0x10); //enable NIV

/********************com scan fuction********************/
write(0,0xda); //23:enable FRC,PWM,LRM sequence

/***********************window****************************
*column and row set fix the display district,for example
*when AC[0]=1,AC[1]=0;(automatic wraparound,column first)
*column auto_icrement will restart after the end address
*********************************************************/

write(0,0xf4); //31:wpc0:column
write(0,0x25); //start from 130
write(0,0xf6); //33:wpc1
write(0,0x5A); //end of:272
write(0,0xf5); //32:wpp0:row
write(0,0x00); //start from 0
write(0,0xf7); //34:wpp1
write(0,0x9F); //end 160
write(0,0xf8); //35:inside mode
write(0,0x89); //13:RAM control
write(0,0xad); //18:display on,select on/off mode.Green Enhance mode disable


/************************scroll line*********************/

write(0,0x40); //8:low bit of scroll line
write(0,0x50); //8:high bit of scroll line
write(0,0xc4); //19,enable FLT and FLB
write(0,0x90); //14:FLT,FLB set
write(0,0x00);

/**********************partial display*******************/

write(0,0x84); //12,set partial display control:off
write(0,0xf1); //28:com end
write(0,0x9f); //160
write(0,0xf2); //29:display start
write(0,0); //0
write(0,0xf3); //30:display end
write(0,159); //160

}

void words(uchar x,uchar y,uchar type,uchar *p) //type=1,ascii;type=2,Chinese character
{                         //x,y fix the location where character display
uchar i,k,j,m,n,l,x0,dat0,dat1,dat2,dat3,dat4,dat5,dat6;//x should be the mutiples of 3
x=37+x;
x0=0x00|(x&0x0f);
x=0x10|((x&0xf0)>>4);
for(i=0;i<3;i++)
{
n=i*12*type;
for(j=0;j<8;j++)
{
m=i*8+j;
write(0,0x89);
write(0,x0);
write(0,x);
write(0,0x60|((y+m)&0x0f));
write(0,0x70|(((y+m)&0xf0)>>4));
for(k=0;k<2*type;k++) //a hexadecimal controlls 2 pixel
{                      //a display unit contains 3 pixel
l=k*6+n; //so column must be mutiples of 2 and 3
dat6=0x01<<j; //or else some colunm will be covered or lost
dat0=(*(p+l))&dat6;
dat0=dat0>>j;
dat0<<=7;

dat1=(*(p+l+1))&dat6;
dat1=dat1>>j;
dat1<<=3;

dat2=*(p+2+l)&dat6;
dat2=dat2>>j;
dat2<<=7;

dat3=(*(p+3+l))&dat6;
dat3=dat3>>j;
dat3<<=3;

dat4=(*(p+4+l))&dat6;
dat4=dat4>>j;
dat4<<=7;

dat5=(*(p+5+l))&dat6;
dat5=dat5>>j;
dat5<<=3;

write(1,dat0|dat1);
write(1,dat2|dat3);
write(1,dat4|dat5);

}

write(0,0x88);

}

}

write(0,0x89);

}

void picture(uchar *p)
{
uchar i,k;
write(0,0x60); //row address LSB
write(0,0x70); //row address MSB
write(0,0x05); //culomn address LSB
write(0,0x12); //culomn address MSB
        
for(i=0;i<160;i++)
{
for(k=0;k<81;k++) //1 hexadecimal controlls 2 pixel
{                 //a display unit contains 3 pixel
        write(1,*p++);
}
}
}

void lcdscan(uchar dat1,uchar dat2)
{
uchar i,j;
write(0,0x60); //row address LSB
write(0,0x70); //row address MSB
write(0,0x05); //culomn address LSB
write(0,0x12); //culomn address MSB
for(j=0;j<160;j++)
{
for(i=0;i<27;i++)
{
if(j%2==0)
{
write(1,dat1);
write(1,dat1);
write(1,dat1);
}
else
{
write(1,dat2);
write(1,dat2);
write(1,dat2);
}
}
}
}
        
void character(void)
{
uchar *q;
uchar i,j,temp[3],table[6];
lcdscan(0x00,0x00);
for(i=0;i<5;i++)
{
   q=hanzi+i*72;
   j=9*i+4;
   words(j,10,2,q);
}
for(i=0;i<11;i++)
{
   q=zimu+i*36;
   j=4*i+4;
   words(j,40,1,q);
}

for(i=11;i<18;i++)
{
   q=zimu+i*36;
   j=4*(i-11)+4;        
        
        words(j,70,1,q);
}
for(i=18;i<25;i++)
{
   q=zimu+i*36;
   j=4*(i-18)+1;
   words(j,100,1,q);
}

temp[0]=read(0);
temp[1]=read(0);
temp[2]=read(0);
table[0]=(temp[0]&0xf0)>>4;
table[1]=temp[0]&0x0f;
q=ascii+table[0]*36;
words(29,100,1,q);
q=ascii+table[1]*36;
words(33,100,1,q);


table[2]=(temp[1]&0xf0)>>4;
table[3]=temp[1]&0x0f;
q=ascii+table[2]*36;
words(37,100,1,q);
q=ascii+table[1]*36;
words(41,100,1,q);


table[4]=(temp[2]&0xf0)>>4;
table[5]=temp[2]&0x0f;
q=ascii+table[4]*36;
words(45,100,1,q);
q=ascii+table[5]*36;
words(49,100,1,q);

}

void readdata(void)
{
uchar l,m,n,*q;
write(0,0x88);
write(0,0x60); //row address LSB
write(0,0x70); //row address MSB
write(0,0x05); //culomn address LSB
write(0,0x12); //culomn address MSB
l=read(1);
m=(l&0xf0)>>4;
n=l&0x0f;
q=ascii+36*m;
words(0,130,1,q);
q=ascii+36*n;
words(5,130,1,q);
}

void main(void)
        
{
uchar *p;
uchar i,j,k;
bl=1;
IE=0X81;
IP=0X01;
TCON=0X00;
init();
while(1)
{

write(0,0x84); //12,set partial display off

lcdscan(0xf0,0x0f); //雪花
delay_ms(1000);

p=cha; //交叉圖案
picture(p);
delay_ms(500);

// p=hui; //’回‘字圖案
//picture(p);
//delay_ms(500);

write(0xff,0xff); //all pixel on
delay_ms(1500);

lcdscan(0xff,0x00); //橫線
delay_ms(1000);
write(0,0x41); //scroll 1 line
delay_ms(1300);
write(0,0x40); //no scroll


lcdscan(0x0f,0x0f); //豎線
delay_ms(1000);
write(0,0xa7); //inverse display
delay_ms(1500);
write(0,0xa6);

// p=zi; //字符圖案
// picture(p);
// delay_ms(800);

write(0,0x85); //12,set partial display on
for(i=40;i<=160;i+=40) //scroll the screen 8 times
{
j=i&0x0f;
k=(i&0xf0)>>4;

write(0,0x40|j); //low bit of scroll line
write(0,0x50|k); //high bit of scroll line
delay_ms(800);
}


write(0,0x40); //low bit of scroll line
write(0,0x50); //high bit of scroll line

// readdata();
// delay_ms(1500);


lcdscan(0x00,0x00);
character();
delay_ms(1300);

/* for(i=0;i<=32;i+=8) //ajust contrast
{
write(0,0x81); //electronic potentionmeter
write(0,180+i); //
delay_ms(1000);
}
write(0,0x81); //electronic potentionmeter
write(0,206); //
*/

lcdscan(0x00,0x00);
}
}
void innt0 () interrupt 0
{
do
{
key=1;
delay_us(500);
}
while(key==1);
}


main1.c(598): warning C206: 'read': missing function-prototype
main1.c(598): error C267: 'read': requires ANSI-style prototype
main1.c(648): error C202: 'bl': undefined identifier
Target not created.



最佳答案

查看完整內容

提示信息說的很清楚了,read()這個函數沒找著,‘BI’這個變一沒有定義。 要學會看提示信息的說。。。這個算是基本功了。
分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復

使用道具 舉報

沙發
ID:824490 發表于 2022-1-13 22:08 | 只看該作者
提示信息說的很清楚了,read()這個函數沒找著,‘BI’這個變一沒有定義。
要學會看提示信息的說。。。這個算是基本功了。
回復

使用道具 舉報

板凳
ID:514901 發表于 2022-1-14 09:23 | 只看該作者
都是未定義,read函數和bl變量沒有定義
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

手機版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表
主站蜘蛛池模板: 韩日在线 | 日韩在线资源 | 日韩欧美三级 | 在线中文字幕av | 91视频三区| 岛国av在线免费观看 | 蜜臀91视频 | 古装三级在线播放 | 午夜精品视频一区 | 日韩综合网 | 四虎影视一区二区 | 国产一区二区在线播放 | 在线一区 | 国产成人一区二区三区 | 欧美日韩在线播放 | 男人天堂视频在线观看 | 成人免费共享视频 | 亚洲视频免费在线看 | 午夜精品久久久久久久久久久久 | 久久久久91| 欧美视频成人 | 久久久久久国产精品mv | 国产在线第一页 | 香蕉视频1024| 欧美黄 片免费观看 | 精品欧美一区二区三区免费观看 | 国产99久久精品一区二区永久免费 | 亚洲精品一区二区三区丝袜 | 91成人小视频 | 国产免费观看一区 | 亚洲视频免费在线看 | 日韩免费在线 | 一区视频在线播放 | 久久婷婷国产麻豆91 | 色综合视频 | 国产精品视频偷伦精品视频 | 成人在线免费 | 国内精品久久精品 | 精品三区 | 一区二区三区免费观看 | 欧美日韩一区二区电影 |