Author: DriverMonkey
Contact inforation: 196568501 (qq)
Mail: bookworepeng@hotmail.com
Phone: 13410905075
Key Modification code record:
Modify Point 1:
Note: To adapt ucgui to 32 bit per pixsel
Typedef union {
U32 aColorIndex8 [2];
U32 aColorIndex16 [2];
} LCD _COLORINDEX_UNION;
Key Modification Point 2:
Note: The modification here mainly aims to adapt to linuxframbuffer.
Struct fb_var_screeninfo g_vinfo;
Int g_fbfd, g_fbsize;
Unsigned char * g_fbbuf;
Void init_dummy_driver (void)
{
/* Open video memory */
If (g_fbfd = open ("/dev/fb0", O_RDWR) <0 ){
Exit (1 );
}
/* Get variable display parameters */
If (ioctl (g_fbfd, FBIOGET_VSCREENINFO, & g_vinfo )){
Printf ("Bad vscreeninfo ioctl/n ");
Exit (2 );
}
/* Size of frame buffer */
G_fbsize = g_vinfo.xres * g_vinfo.yres * (g_vinfo.bits_per_pixel/8 );
/* Map video memory */
If (g_fbbuf = mmap (0, g_fbsize, PROT_READ | PROT_WRITE,
MAP_SHARED, g_fbfd, 0) = (void *)-1 ){
Exit (3 );
}
}
Void deinit_dummy_drivr (void)
{
Munmap (g_fbbuf, g_fbsize );
Close (g_fbfd );
}
Key Modification Point 3:
Note: Adapt ucgui to 32 bit per pixsel
# Define I16 signed int/* signed 16 bits .*/
# Define 2010unsigned int/* unsigned 16 bits .*/