(已解决)(求助)关于4.3寸屏幕 TQ2440_Test 屏幕中间白条的问题
本帖最后由 as12312a 于 2012-3-6 20:56 编辑4.3寸屏幕 TQ2440_Test.bin 烧写到板子里运行的时候,天嵌的logo(Lcd_TFT_Test最后一屏)中间显示很大的白色矩形,屏幕底下的图错位了。。。是什么原因造成的呢?改了好久都没改出来,我把开机第一屏的条形图也改成天嵌logo ,出现了一样的问题,看着又显不像是函数的问题。。。 上面那个图是显示的图片,官方编译好的bin文件烧进去也是这样的问题。。
附上画图的函数
void Paint_Bmp(int x0,int y0,int h,int l,unsigned char bmp[])
{
int x,y;
U32 c;
int p = 0;
for( y = y0 ; y < l ; y++ )
{
for( x = x0 ; x < h ; x++ )
{
c = bmp | (bmp<<8) ;
if ( ( (x0+x) < SCR_XSIZE_TFT) && ( (y0+y) < SCR_YSIZE_TFT) )
LCD_BUFFER = c ;
p = p + 2 ;
}
}
}
函数都是官方出厂时的函数,没改过,官方编译好的bin文件烧进去也是这样的问题。。
你是烧到nand中测试还是是直接烧SDRAM里边?烧nand的话如果你的镜像编译出来比较大就修改下nand.c中的RdNF2SDRAM函数,把size改大点试试 bin文件编译出来是538k 画图函数本身没有问题哦。这个问题你可以这样试试。下载到NAND中,然后从NAND启动。一般就没问题了。还有你的主函数显示语句要给我们看看啊。。。。 void Lcd_TFT_Init(void)
{
Lcd_Init();
Lcd_PowerEnable(0, 1);
Lcd_EnvidOnOff(1); //turn on vedio
Lcd_ClearScr( (0x00<<11) | (0x00<<5) | (0x00) );
#define LCD_BLANK 12
#define C_UP ( LCD_XSIZE_TFT - LCD_BLANK*2 )
#define C_RIGHT ( LCD_XSIZE_TFT - LCD_BLANK*2 )
#define V_BLACK ( ( LCD_YSIZE_TFT - LCD_BLANK*4 ) / 6 )
Glib_FilledRectangle( LCD_BLANK, LCD_BLANK, ( LCD_XSIZE_TFT - LCD_BLANK ), ( LCD_YSIZE_TFT - LCD_BLANK ),0x0000); //fill a Rectangle with some color
Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*0), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*1),0x001f); //fill a Rectangle with some color
Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*1), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*2),0x07e0); //fill a Rectangle with some color
Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*2), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*3),0xf800); //fill a Rectangle with some color
Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*3), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*4),0xffe0); //fill a Rectangle with some color
Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*4), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*5),0xf81f); //fill a Rectangle with some color
Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*5), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*6),0x07ff); //fill a Rectangle with some color
Glib_Line( LCD_BLANK,LCD_BLANK, (LCD_XSIZE_TFT-LCD_BLANK), (LCD_YSIZE_TFT-LCD_BLANK), 0x0000 ) ;
Glib_Line( LCD_BLANK,(LCD_YSIZE_TFT-LCD_BLANK), (LCD_XSIZE_TFT-LCD_BLANK), LCD_BLANK, 0x0000 ) ;
Glib_Line( (LCD_XSIZE_TFT/2),(LCD_BLANK*2 + V_BLACK*0), (LCD_XSIZE_TFT/2), (LCD_BLANK*2 + V_BLACK*6), 0x0000 ) ;
}
void Lcd_TFT_Test( void )
{
Uart_Printf("\nTest TFT LCD!\n");
Lcd_ClearScr( (0x00<<11) | (0x00<<5) | (0x00)); //clear screen
Uart_Printf( "\nDisplay Black! Press any key to continue!\n" );
Uart_Getch() ; //wait uart input
Lcd_ClearScr( (0x1f<<11) | (0x3f<<5) | (0x1f)); //clear screen
Uart_Printf( "Display White! Press any key to continue!\n" );
Uart_Getch() ; //wait uart input
Lcd_ClearScr( (0x00<<11) | (0x00<<5) | (0x1f)); //clear screen
Uart_Printf( "Display Blue! Press any key to continue!\n" );
Uart_Getch() ; //wait uart input
Lcd_ClearScr( (0x00<<11) | (0x3f<<5) | (0x00)); //clear screen
Uart_Printf( "Display Green! Press any key to continue!\n" );
Uart_Getch() ; //wait uart input
Lcd_ClearScr( (0x1f<<11) | (0x00<<5) | (0x00)); //clear screen
Uart_Printf( "Display Red! Press any key to continue!\n" );
Uart_Getch() ; //wait uart input
/* Lcd_ClearScr( (0x00<<11) | (0x3f<<5) | (0x1f)); //clear screen
Uart_Printf( "LCD clear screen is finished! press any key to continue!\n" );
Uart_Getch() ; //wait uart input
Lcd_ClearScr( (0x1f<<11) | (0x00<<5) | (0x1f)); //clear screen
Uart_Printf( "LCD clear screen is finished! press any key to continue!\n" );
Uart_Getch() ; //wait uart input
Lcd_ClearScr( (0x1f<<11) | (0x3f<<5) | (0x00)); //clear screen
Uart_Printf( "LCD clear screen is finished! press any key to continue!\n" );
Uart_Getch() ; //wait uart input
*/
Lcd_ClearScr(0xffff); //fill all screen with some color
#define LCD_BLANK 12
#define C_UP ( LCD_XSIZE_TFT - LCD_BLANK*2 )
#define C_RIGHT ( LCD_XSIZE_TFT - LCD_BLANK*2 )
#define V_BLACK ( ( LCD_YSIZE_TFT - LCD_BLANK*4 ) / 6 )
Glib_FilledRectangle( LCD_BLANK, LCD_BLANK, ( LCD_XSIZE_TFT - LCD_BLANK ), ( LCD_YSIZE_TFT - LCD_BLANK ),0x0000); //fill a Rectangle with some color
Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*0), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*1),0x001f); //fill a Rectangle with some color
Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*1), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*2),0x07e0); //fill a Rectangle with some color
Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*2), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*3),0xf800); //fill a Rectangle with some color
Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*3), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*4),0xffe0); //fill a Rectangle with some color
Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*4), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*5),0xf81f); //fill a Rectangle with some color
Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*5), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*6),0x07ff); //fill a Rectangle with some color
Glib_Line( LCD_BLANK,LCD_BLANK, (LCD_XSIZE_TFT-LCD_BLANK), (LCD_YSIZE_TFT-LCD_BLANK), 0x0000 ) ;
Glib_Line( LCD_BLANK,(LCD_YSIZE_TFT-LCD_BLANK), (LCD_XSIZE_TFT-LCD_BLANK), LCD_BLANK, 0x0000 ) ;
Glib_Line( (LCD_XSIZE_TFT/2),(LCD_BLANK*2 + V_BLACK*0), (LCD_XSIZE_TFT/2), (LCD_BLANK*2 + V_BLACK*6), 0x0000 ) ;
#if(LCD_Type == LCDT35)
Uart_Printf( "Press any key to continue!\n" );
Uart_Getch() ; //Any Key To Next
Paint_Bmp(0, 0, 240, 320, TQ_LOGO_240320);
#elif((LCD_Type == LCDW35) || (LCD_Type == LCDS35))
Uart_Printf( "Press any key to continue!\n" );
Uart_Getch() ; //Any Key To Next
Paint_Bmp(0, 0, 320, 240, TQ_LOGO_320240);
#elif(LCD_Type == LCDW43)
Uart_Printf( "Press any key to continue!\n" );
Uart_Getch() ; //Any Key To Next
Paint_Bmp(0, 0, 480, 272, TQ_LOGO_480272);
#elif(LCD_Type == VGA)
Uart_Printf( "Press any key to continue!\n" );
Uart_Getch() ; //Any Key To Next
Paint_Bmp(0, 0, 640, 480, TQ_LOGO_640480);
#elif(LCD_Type == LCDA70)
Uart_Printf( "Press any key to continue!\n" );
Uart_Getch() ; //Any Key To Next
Paint_Bmp(0, 0, 800, 480, TQ_LOGO_800480);
#endif
Uart_Printf("LCD Test Complete!\n");
Uart_Printf("Press any key to quit!\n");
Uart_Getch();
} 本帖最后由 as12312a 于 2012-3-6 19:32 编辑
http://bbs.embedsky.net/data/attachment/forum/201203/06/1903185x33ngnu53v4ttyp.jpg函数是官方工程文件里的,没有改过。。
我烧写的时候是在串口命令下按 a 用 usb 烧入的,这个有影响么?dnw 设置是波特率115200下载地址是0x30000000 我烧写到sdram里面运行,发现图片可以显示了、、这是怎么回事呢? 我知道怎么回事了,我烧写bin文件到nand flash时未格式化nand flash,格式化后再烧写,图片完美显示!! 感谢版主热心帮忙解决问题 兄弟知音哪,我今天也是这个问题,纠结了好半天,一直以为取模软件出了问题呢,直到看见了这贴! as12312a 发表于 2012-3-6 20:55
我知道怎么回事了,我烧写bin文件到nand flash时未格式化nand flash,格式化后再烧写,图片完美显示!!
哗,你太聪明了啊.这个问题纠结了我两天了,直到看到你的贴子,前人栽树后人乘凉,谢谢你的贴子啊!格一格完美显示,但是这是为什么呢?
页:
[1]