zoukankan      html  css  js  c++  java
  • 关闭2440 屏幕背光

    //backlight.c

    ***************************************************************************

    #include <stdlib.h>
    #include <stdio.h>
    #include <fcntl.h>
    #include <string.h>
    #include <sys/ioctl.h> 
    #include <linux/fb.h>

    int main(int argc, char** argv)
    {
       if ( argc == 1 )
             {
       printf("Useage:backlight on\n");
       printf("       backlight off\n");
             return 1;

           }

       int fb = open("/dev/fb0", O_RDWR);
       if( fb < 0 )
           {
      printf("Cann't open /dev/fb0\n");
      return 1;
           }

     if( strcmp( argv[1], "on" ) == 0 )
         ioctl(fb, FBIOBLANK, 0 );
       else if( strcmp( argv[1], "off" ) == 0 )
       ioctl(fb, FBIOBLANK, 1 );
     else
     {
       printf("Useage Error ......\n");
       printf("Useage:backlight on\n");
       printf("       backlight off\n");
     }

       close(fb);

     return 0;

    }

    ***************************************************************************

    Makefile

    ***************************************************************************

    all:
     arm-linux-gcc -g backlight.c -ljpeg -o backlight
    clean:
     rm -f backlight

    ***************************************************************************

  • 相关阅读:
    MCU开发之I2C通信
    hibernate特殊的映射
    Hibernate使用
    css设置让a标签充满整个li
    margin
    border属性
    列表
    链接样式
    相机内参外参
    tmux
  • 原文地址:https://www.cnblogs.com/Neddy/p/2290425.html
Copyright © 2011-2022 走看看