From b83d15a461ef7cf0dc465735487d43aa92b1402c Mon Sep 17 00:00:00 2001 From: Florian Streibelt Date: Fri, 14 Oct 2011 01:48:28 +0200 Subject: [PATCH] finally{} --- client-barcode/freitagskasse.py | 2 +- display-daemon/ser.c | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/client-barcode/freitagskasse.py b/client-barcode/freitagskasse.py index d7774eb..79f4d3c 100644 --- a/client-barcode/freitagskasse.py +++ b/client-barcode/freitagskasse.py @@ -234,7 +234,7 @@ class Status: # Show final balance for some time clear() self.dump() - print_display('\x0bDanke,%-14s' % (self.login_name[:13]+"!") ) + print_display('\x0bDanke, %-12s' % (self.login_name[:12]+"!") ) delay('Logout', 3) # Logout diff --git a/display-daemon/ser.c b/display-daemon/ser.c index f609d21..d5704a3 100644 --- a/display-daemon/ser.c +++ b/display-daemon/ser.c @@ -20,6 +20,7 @@ int fd; +int display_dirty=0; int screensaver; int brightness = 4; int offset = 0; @@ -108,9 +109,9 @@ char display_set_timer[] = { 0x1F, 0x54 }; #define TIME_BASE 200000 #define TB_TO_SECS(x) (x*1000000/TIME_BASE) -#define TIME_CLOCK TB_TO_SECS(5) +#define TIME_CLOCK TB_TO_SECS(65) #define TIME_DIM TB_TO_SECS(90) -#define TIME_OFF TB_TO_SECS(320) +#define TIME_OFF TB_TO_SECS(520) #define DEVICE "/dev/ttyUSB0" @@ -220,6 +221,11 @@ rthread (void *args) { screensaver = 0; + if (display_dirty) { + printf("DEBUG: resetting display\n"); + SEND_DISPLAY_INIT; + display_dirty=0; + } display_dim (4); if (pc == '\n') @@ -363,10 +369,12 @@ main (int argc, char **argv) if (screensaver == TIME_CLOCK) { + display_dirty=1; showtime (); } if (screensaver == TIME_OFF) { + display_dirty=1; display_dim (0); } @@ -374,6 +382,7 @@ main (int argc, char **argv) //show a scroll text while the screensaver is active... if ((screensaver > (TIME_CLOCK + 10)) && (screensaver < TIME_OFF)) { + display_dirty=1; scrolltext(); }