blank.c File Reference

#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include "delta.h"
Include dependency graph for blank.c:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Copyright (C) 2008 iRex Technologies B.V. All rights reserved.

Definition at line 70 of file blank.c.

References display_update_info::color, FBIO_DELTA_ERASE, and display_update_info::waveform.

00071 {
00072     int fbdev;
00073     int ret;
00074     struct display_update_info updateinfo;
00075     int color = 15; // white
00076 
00077     fbdev = open ("/dev/fb0", O_RDWR);
00078     
00079     if (argc == 2)
00080     {
00081         color = atoi(argv[1]);
00082     }
00083    
00084     if (fbdev == -1) 
00085     {
00086         printf("Error opening framebuffer device. # mknod /dev/fb0 c 29 0\n");
00087         exit(-1);
00088     }
00089 
00090     updateinfo.waveform = 0; // full
00091     updateinfo.color = color;
00092     
00093     color = ((color & 0xf) << 4) + color;
00094     printf ("Doing FBIO_DELTA_ERASE(%d)\n", color);
00095         
00096     if ((ret=ioctl(fbdev, FBIO_DELTA_ERASE, &updateinfo))) 
00097     { 
00098         printf("Error sending FBIO_DELTA_ERASE: %x\n",ret); 
00099         exit(-1); 
00100     }
00101 
00102     close(fbdev);
00103 
00104     return 0;
00105 }

Generated by  doxygen 1.6.2-20100208