cursor off/full display init after resume

This commit is contained in:
Florian Streibelt 2011-10-14 20:46:25 +02:00
parent b83d15a461
commit d6e277fac4
1 changed files with 12 additions and 12 deletions

View File

@ -160,6 +160,14 @@ showtime (void)
display_write (msg, strlen (msg));
}
void
send_display_init(){
SEND_DISPLAY_INIT;
SEND_CURSOR_OFF;
SEND_DISPLAY_ON;
SEND_MODE_OVERWRITE;
}
void
display_dim (short i)
{
@ -177,10 +185,7 @@ display_dim (short i)
char *d;
if (brightness == 0)
{
SEND_CURSOR_OFF;
// turn display on again
SEND_DISPLAY_ON;
SEND_MODE_OVERWRITE;
send_display_init();
char c[4] = { 0x1f, 0x58, 0x04, 0x00 };
l = 6;
//c[5]=i;
@ -223,7 +228,7 @@ rthread (void *args)
screensaver = 0;
if (display_dirty) {
printf("DEBUG: resetting display\n");
SEND_DISPLAY_INIT;
send_display_init();
display_dirty=0;
}
display_dim (4);
@ -246,10 +251,7 @@ void
sighandler (int sig)
{
pthread_kill (thread1, 0);
SEND_DISPLAY_INIT;
SEND_MODE_OVERWRITE;
SEND_CURSOR_OFF;
send_display_init();
SEND_DISPLAY_OFF;
close (fd);
@ -324,9 +326,7 @@ main (int argc, char **argv)
initport (fd);
//init display, set, vertical scroll, cursor off
SEND_DISPLAY_INIT;
SEND_MODE_OVERWRITE;
SEND_CURSOR_OFF;
send_display_init();
pthread_create (&thread1, NULL, rthread, NULL);
signal (SIGINT, sighandler);