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