From d6e277fac4e49eba181a92018ee8612a26c481b6 Mon Sep 17 00:00:00 2001 From: Florian Streibelt Date: Fri, 14 Oct 2011 20:46:25 +0200 Subject: [PATCH] cursor off/full display init after resume --- display-daemon/ser.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/display-daemon/ser.c b/display-daemon/ser.c index d5704a3..287f4e4 100644 --- a/display-daemon/ser.c +++ b/display-daemon/ser.c @@ -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);