如图,使用原子哥给的例程修改后的ucGUI界面 每次刷全屏的时候智能刷左边,右边刷不掉。
只调用修改的画点函数就没有问题,我修改了画水平线和垂直线的函数就有问题。
/***************************
区域内填充颜色,可以为一个直线,水平或者垂直线也属于区域
;x x起始地址
; y y起始地址
; xW 填充宽度
; yH 填充高度
;color 填充颜色
****************************/
void Lcd_DispColor( u16 x, u16 y, u16 xW, u16 yH, u16 color )
{
u32 num;
u32 i;
u8 ch, cl;
num = xW * yH;
ch = ( color >> 8 ) & 0xFF;
cl = color & 0xFF;
DispAddrRst();
DispAddrSet( x, y, xW, yH );
SendDataSet();
for( i = 0; i < num; i++ )
{
SendData8H8L( ch, cl );
}
SendDataClr();
}
//修改后只用于画水平线horizontal
void Lcd_DrawHLine( u16 Xs, u16 Ys, u16 Xe, u16 Ye, u16 color )
{
//Ys=Ye;
( Xs < Xe ) ? Lcd_DispColor( Xs, Ys, Xe - Xs, 1 , color ) : Lcd_DispColor( Xe, Ys, Xs - Xe, 1 , color );
Delay( 2000 );
}
//修改后只用于画垂直线
void Lcd_DrawVLine( u16 Xs, u16 Ys, u16 Xe, u16 Ye, u16 color )
{
//Xs=Xe;
( Ys < Ye ) ? Lcd_DispColor( Xs, Ys, 1, Ye - Ys, color ) : Lcd_DispColor( Xs, Ye, 1, Ys - Ye, color );
}
ili9320_ucgui.c中的函数如下,
int LCD_L0_Init( void )
{
ili9320_Initializtion();
return 0;
}
void LCD_L0_SetPixelIndex( int x, int y, int PixelIndex )
{
ili9320_SetPoint( x, y, PixelIndex );
}
unsigned int LCD_L0_GetPixelIndex( int x, int y )
{
return ili9320_GetPoint( x, y );
}
void LCD_L0_SetOrg( int x, int y )
{
}
void LCD_L0_XorPixel( int x, int y )
{
LCD_PIXELINDEX Index = ili9320_GetPoint( x, y );
ili9320_SetPoint( x, y, LCD_NUM_COLORS - 1 - Index );
}
void LCD_L0_DrawHLine( int x0, int y, int x1 )
{
// GUI_Line( x0, y, x1, y, LCD_COLORINDEX ); //原函数
// DispColor( x0, y, x1, y, LCD_COLORINDEX );
Lcd_DrawHLine( x0, y, x1, y, LCD_COLORINDEX ); //
}
void LCD_L0_DrawVLine( int x, int y0, int y1 )
{
// GUI_Line( x, y0, x, y1, LCD_COLORINDEX ); //原函数
// DispColor( x, y0, x, y1, LCD_COLORINDEX );
Lcd_DrawVLine( x, y0,x, y1, LCD_COLORINDEX );
}
我用的控制器是9163c,谁知道为什么会出现这种问题。
|