在线时间289 小时
UID198020
ST金币0
蝴蝶豆32
注册时间2007-7-22
金牌会员
- 最后登录
- 2020-11-10
|
a0a.1 0b0c
请教高手:我现在可以从SD卡中读出数据(抄袭的),但是当送入TFT屏显示就不对了,用串口查看数据,没有错误的,相关代码如下:
我的QQ:519212866
//图片显示函数,此函数显示一个图片是正常的
uchar tupian[]=
{
0X00,0X34,0X56,
0X00,0X34,0X56,
0X00,0X34,0X56,
0X00,0X34,0X56,
0X00,0X34,0X56,
0X00,0X34,0X56,
0X00,0X34,0X56,
}
void GUI_DisPicture(uchar x, uint y, uchar length, uint high ,const uchar *pic)
{
uint temp=0,tmp=0,num=0;
LCD_setwindow(x,y,x+length-1,y+high-1);
num=length*high*2;
do
{
temp=pic[tmp]|( pic[tmp+1]FileSize-offset;
znFAT_Seek_File(pfi,offset);
znFAT_ReadSector(pfi->FileCurSector,znFAT_Buffer);
for(i=pfi->FileCurPos;iBytesPerSector;i++)
{
if(counter>=len)
{
return len;
}
(*pfun)(znFAT_Buffer);
counter++;
pfi->FileCurPos++;
pfi->FileCurOffset++;
}
if(pfi->FileCurSector-(SOC(pfi->FileCurCluster))!=(pArg->SectorsPerClust-1))
{
for(j=pfi->FileCurSector+1;jFileCurCluster))+pArg->SectorsPerClust;j++)
{
znFAT_ReadSector(j,znFAT_Buffer);
pfi->FileCurSector=j;
for(i=0;iBytesPerSector;i++)
{
if(counter>=len)
{
return len;
}
(*pfun)(znFAT_Buffer);
counter++;
pfi->FileCurPos++;
pfi->FileCurOffset++;
}
}
}
temp=(len-counter)/(pArg->BytesPerSector*pArg->SectorsPerClust);
for(k=0;kFileCurCluster=znFAT_GetNextCluster(pfi->FileCurCluster);
for(j=(SOC(pfi->FileCurCluster));jFileCurCluster))+pArg->SectorsPerClust;j++)
{
znFAT_ReadSector(j,znFAT_Buffer);
pfi->FileCurSector=j;
for(i=0;iBytesPerSector;i++)
{
if(counter>=len)
{
return len;
}
(*pfun)(znFAT_Buffer);
counter++;
pfi->FileCurOffset++;
pfi->FileCurPos++;
pfi->FileCurPos%=pArg->BytesPerSector;
}
}
}
pfi->FileCurCluster=znFAT_GetNextCluster(pfi->FileCurCluster);
temp=(SOC(pfi->FileCurCluster))+((len-counter)/pArg->BytesPerSector);
pfi->FileCurSector=(SOC(pfi->FileCurCluster));
for(j=(SOC(pfi->FileCurCluster));jFileCurSector=j;
for(i=0;iBytesPerSector;i++)
{
if(counter>=len)
{
return len;
}
(*pfun)(znFAT_Buffer);
counter++;
pfi->FileCurPos++;
pfi->FileCurPos%=pArg->BytesPerSector;
pfi->FileCurOffset++;
}
}
pfi->FileCurSector=j;
znFAT_ReadSector(pfi->FileCurSector,znFAT_Buffer);
temp=len-counter;
for(i=0;i=len)
{
return len;
}
(*pfun)(znFAT_Buffer);
counter++;
pfi->FileCurPos++;
pfi->FileCurPos%=pArg->BytesPerSector;
pfi->FileCurOffset++;
}
}
else
{
len=0;
}
return len;
}
void main()
{
GUI_DisPicture(0, 0, 240, 320 ,tupian); //比如是这个数组里面的数据时240*320的数据,这个显示是正常的
FAT_Read_FileX(&FileInfo,0,FileInfo.FileSize,disp_sd); //这样调用后,TFT屏上就显示几个点,请问要怎样修改才能够让他把读出的数据(图片)正常的显示出来啊?????????????
}
|
|