使用以下画点函数不能实现画点void DrawPixel(u16 x, u16 y, u16 Color){
WriteComm(0x2a);
WriteData(x>>8);
WriteData(x&0xff);
WriteData((x+1)>>8);
WriteData((x+1)&0xff);
WriteComm(0x2b);
WriteData(y>>8);
WriteData(y&0xff);
WriteData((y+1)>>8);
WriteData((y+1)&0xff);
WriteComm(0x2c);
*(__IO u16 *) (Bank1_LCD_D) = Color;
}
但是如果*(__IO u16 *) (Bank1_LCD_D) = Color循环两次就可以实现
void DrawPixel(u16 x, u16 y, u16 Color){
u16 i;
WriteComm(0x2a);
WriteData(x>>8);
WriteData(x&0xff);
WriteData((x+1)>>8);
WriteData((x+1)&0xff);
WriteComm(0x2b);
WriteData(y>>8);
WriteData(y&0xff);
WriteData((y+1)>>8);
WriteData((y+1)&0xff);
WriteComm(0x2c);
for(i=0;i<2;i++){
*(__IO u16 *) (Bank1_LCD_D) = Color;
}
}
问题又来了,使用第二个画点函数,全部屏幕用画点函数实现就会出现一条条的,如下图所示,绿 {MOD}部分为画点实现,红 {MOD}部分为区域填充方式,可以明显看到绿 {MOD}区域有断片,求助怎么解决
一周热门 更多>