I grep dmesg to look for ft5406 to check that the 7 inch display is connected. This device no longer seems to exist. I can get round this.
The big problem is that I write directly to the framebuffer to display on the screen and all the parameters seem to have changed. This is what I do:
Code: Select all
int initScreen(void)
{
struct fb_var_screeninfo vinfo;
struct fb_fix_screeninfo finfo;
fbfd = open("/dev/fb0", O_RDWR);
if (!fbfd)
{
printf("Error: cannot open framebuffer device.\n");
return(0);
}
if (ioctl(fbfd, FBIOGET_FSCREENINFO, &finfo))
{
printf("Error reading fixed information.\n");
return(0);
}
if (ioctl(fbfd, FBIOGET_VSCREENINFO, &vinfo))
{
printf("Error reading variable information.\n");
return(0);
}
screenXsize=vinfo.xres;
screenYsize=vinfo.yres;
screenSize = finfo.smem_len;
fbp = (char*)mmap(0, screenSize, PROT_READ | PROT_WRITE, MAP_SHARED, fbfd, 0);
if ((int)fbp == -1)
{
return 0;
}
else
{
return 1;
}
}Code: Select all
void setPixel(int x, int y, int R, int G, int B)
{
int p; // Pixel Memory offset
if ((x < 800) && (y < 480))
{
p=(x + screenXsize * y) * 4;
memset(fbp + p, B, 1); // Blue
memset(fbp + p + 1, G, 1); // Green
memset(fbp + p + 2, R, 1); // Red
memset(fbp + p + 3, 0x80, 1); // A
}
else
{
printf("Error: Trying to write pixel outside screen bounds.\n");
}
}
Thanks
Dave
