初级会员

- 积分
- 153
- 金钱
- 153
- 注册时间
- 2016-10-22
- 在线时间
- 37 小时
|
LED实验,画点测试。所有X=0的点都无法显示,感觉像是X=0的那部分液晶点全部坏掉了一样。很奇怪。
点击看大图
M1
M2
代码如下:
// 画点
void lcd_draw_point(unsigned int x, unsigned int y, unsigned int color) {
unsigned int* p = (unsigned int*)(tftlcd_dev.frame_buffer + tftlcd_dev.pixel_size * (tftlcd_dev.width * y + x));
*p = color;
}
// 读点
unsigned int lcd_read_point(unsigned int x, unsigned int y) {
unsigned int* p = (unsigned int*)(tftlcd_dev.frame_buffer + tftlcd_dev.pixel_size * (tftlcd_dev.width * y + x));
return *p;
}
void clean_screen(unsigned int color) {
unsigned int size = tftlcd_dev.width * tftlcd_dev.height;
unsigned int* p = (unsigned int*)tftlcd_dev.frame_buffer;
unsigned int i;
for (i = 0; i < size; i++) {
p = color;
}
}
|
|