Removed LCD auto dim mode, the display is allways on if this program runs.

Mon, 21 Dec 2015 21:21:16 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Mon, 21 Dec 2015 21:21:16 +0100
changeset 468
e8203e891b0e
parent 467
f4d75ef899f4
child 469
d26def846029

Removed LCD auto dim mode, the display is allways on if this program runs.

brewco/brewco.c file | annotate | diff | comparison | revisions
brewco/keyboard.c file | annotate | diff | comparison | revisions
--- a/brewco/brewco.c	Mon Dec 21 21:09:36 2015 +0100
+++ b/brewco/brewco.c	Mon Dec 21 21:21:16 2015 +0100
@@ -663,7 +663,8 @@
      */
     usleep(1500000);
     prompt(0, NULL);
-//    stopLCD();
+    setBacklight(0);
+
     if (sock != -1) {
 	if (shutdown(sock, SHUT_RDWR)) {
 	    syslog(LOG_NOTICE, "Can't shutdown socket: %s", strerror(errno));
--- a/brewco/keyboard.c	Mon Dec 21 21:09:36 2015 +0100
+++ b/brewco/keyboard.c	Mon Dec 21 21:21:16 2015 +0100
@@ -33,16 +33,6 @@
 #define PRESS_NORMAL    5
 #define PRESS_LONG      200
 
-/*
- * LCD timeout in seconds
- */
-#define LCD_SLEEP       120
-
-/*
- * Menu timeout in seconds
- */
-#define MENU_TIMEOUT    60
-
 
 
 extern int		my_shutdown;
@@ -58,7 +48,6 @@
 int			Key_Down = FALSE;
 
 int			previous_key = KEY_NONE;
-int			menutimer = 0;
 
 
 int keypressed(void);
@@ -128,7 +117,7 @@
 void *my_keyboard_loop(void *threadid)
 #endif
 {
-    int		Return = 0, Enter = 0, Up = 0, Down = 0, Backlight = LCD_SLEEP, AnyKey = FALSE;
+    int		Return = 0, Enter = 0, Up = 0, Down = 0;
     time_t	Last = (time_t)0, Now;
 
 #ifdef HAVE_WIRINGPI_H
@@ -201,45 +190,9 @@
 		Key_Down = TRUE;
 	}
 
-	if (Key_Enter || Key_Return || Key_Up || Key_Down) {
-	    AnyKey = TRUE;
-	    /*
-	     * Any key is pressed.
-	     */
-#ifdef HAVE_WIRINGPI_H
-	    piLock(LOCK_LCD);
-#endif
-	    setBacklight(1);
-#ifdef HAVE_WIRINGPI_H
-	    piUnlock(LOCK_LCD);
-#endif
-	    Backlight = LCD_SLEEP;
-	    menutimer = 0;
-	} else {
-	    /*
-	     * No key pressed.
-	     */
-	    AnyKey = FALSE;
-	}
-
 	Now = time(NULL);
 	if (Now != Last) {
 	    Last = Now;
-
-	    if (AnyKey == FALSE) {
-		if (Backlight == 1) {
-#ifdef HAVE_WIRINGPI_H
-		    piLock(LOCK_LCD);
-#endif
-		    setBacklight(0);
-#ifdef HAVE_WIRINGPI_H
-		    piUnlock(LOCK_LCD);
-#endif
-		}
-		if (Backlight > 0) {
-		    Backlight--;
-		}
-	    }
 	}
 
 	/*

mercurial