thermferm/panel.c

changeset 241
4ba138737bf4
parent 238
a0f1deb65889
child 244
2f868eaefec2
--- a/thermferm/panel.c	Thu Aug 14 22:43:41 2014 +0200
+++ b/thermferm/panel.c	Fri Aug 15 14:38:32 2014 +0200
@@ -158,7 +158,9 @@
 	    /*
 	     * Any key is pressed.
 	     */
+	    piLock(LOCK_LCD);
 	    setBacklight(1);
+	    piUnlock(LOCK_LCD);
 	    Backlight = LCD_SLEEP;
 	    menutimer = 0;
 	} else {
@@ -173,8 +175,11 @@
 	    Last = Now;
 
 	    if (AnyKey == FALSE) {
-		if (Backlight == 1)
+		if (Backlight == 1) {
+		    piLock(LOCK_LCD);
 		    setBacklight(0);
+		    piUnlock(LOCK_LCD);
+		}
 		if (Backlight > 0) {
 		    Backlight--;
 		}

mercurial