00001 /* 00002 * File Name: blank.c 00003 */ 00004 00005 /* 00006 * This file is part of sysd. 00007 * 00008 * sysd is free software: you can redistribute it and/or modify 00009 * it under the terms of the GNU General Public License as published by 00010 * the Free Software Foundation, either version 2 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * sysd is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00020 */ 00021 00022 /** 00023 * Copyright (C) 2008 iRex Technologies B.V. 00024 * All rights reserved. 00025 */ 00026 00027 //---------------------------------------------------------------------------- 00028 // Include Files 00029 //---------------------------------------------------------------------------- 00030 00031 #include "config.h" 00032 00033 // system include files, between < > 00034 #include <stdio.h> 00035 #include <stdlib.h> 00036 #include <unistd.h> 00037 #include <fcntl.h> 00038 #include <sys/ioctl.h> 00039 00040 // ereader include files, between < > 00041 00042 // local include files, between " " 00043 #include "delta.h" 00044 00045 00046 //---------------------------------------------------------------------------- 00047 // Type Declarations 00048 //---------------------------------------------------------------------------- 00049 00050 00051 //---------------------------------------------------------------------------- 00052 // Global Constants 00053 //---------------------------------------------------------------------------- 00054 00055 00056 //---------------------------------------------------------------------------- 00057 // Static Variables 00058 //---------------------------------------------------------------------------- 00059 00060 00061 //============================================================================ 00062 // Local Function Definition 00063 //============================================================================ 00064 00065 00066 //============================================================================ 00067 // Functions Implementation 00068 //============================================================================ 00069 00070 int main(int argc, char *argv[]) 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 }