thermferm/panel.c

changeset 205
ca18ff45deba
parent 204
9a14d6b2de7f
child 213
2317b8d644fa
--- a/thermferm/panel.c	Sun Aug 10 12:09:07 2014 +0200
+++ b/thermferm/panel.c	Sun Aug 10 13:26:35 2014 +0200
@@ -30,6 +30,7 @@
 
 extern int		my_shutdown;
 extern int		debug;
+extern int		setupmenu;
 
 int			Key_Enter = FALSE;
 int			Key_Enter_Long = FALSE;
@@ -37,6 +38,19 @@
 int			Key_Down = FALSE;
 
 int			previous_key = KEY_NONE;
+int			menutimer = 0;
+
+int			Led_Off = 0;
+int			Led_On = 100;
+
+
+/*
+ * LED flash patterns, on, off. Times in 10 mSecs.
+ */
+const int		LED_OFF[2]	= { 0, 100 };
+const int		LED_ON[2]	= { 100, 0 };
+const int		LED_WARN[2]	= { 5, 95 };
+const int		LED_ALARM[2]	= { 50, 50 };
 
 
 
@@ -63,7 +77,7 @@
     if (Key_Enter && Key_Up && Key_Down)
 	return KEY_ALL;
     if (Key_Up && Key_Down)
-	return KEY_UPDOWN;
+	return KEY_ESCAPE;
     if (Key_Up)
 	return KEY_UP;
     if (Key_Down)
@@ -137,6 +151,7 @@
 	    if (Backlight == 0)
 		setBacklight(1);
 	    Backlight = LCD_SLEEP;
+	    menutimer = 0;
 	} else {
 	    /*
 	     * No key pressed.
@@ -160,8 +175,14 @@
 		if (Backlight > 0) {
 		    Backlight--;
 		}
+
+	    	if (setupmenu != MENU_NONE) {
+		    if (menutimer < MENU_TIMEOUT)
+			menutimer++;
+		    else
+			setupmenu = MENU_NONE;
+		}
 	    }
-
 	}
 
 	/*

mercurial