2440 Lcd10 minute Sleep modification

Source: Internet
Author: User

In our system, the Virtual console of the LCD and the console TTY are not the same devices, that is, if the simple printf in the program is not working! This only modifies the blankinterval of the TTY you are using, and you are using a text-only device that does not have a black screen problem.
So, you need to carefully compare/dev/console,/dev/tty,/dev/ttyn device number, in my system, the user program/dev/console and/dev/tty are 5, indicating they are a thing,/dev/ttyn is 4, This is the Virtual Console on FB. But/dev/ttyn is not a TTY in use, so how about printf? Had to use the write function to solve.

Write a code like this:
#include <fcntl.h>
#include <stdio.h>
#include <sys/ioctl.h>

void Some_function ()
{
int F;
f = open ("/dev/tty0", O_RDWR);
Write (F, "/033[9;0]", 8);
Close (f);
}

Modify User program, add code to set Blankinterval (recommended)

2440 Lcd10 minute Sleep modification

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.