thermferm/panel.c

changeset 728
da038d0bed04
parent 724
01e3936f62d4
equal deleted inserted replaced
727:78744b7e6021 728:da038d0bed04
186 if (Key_Enter || Key_Up || Key_Down) { 186 if (Key_Enter || Key_Up || Key_Down) {
187 AnyKey = TRUE; 187 AnyKey = TRUE;
188 /* 188 /*
189 * Any key is pressed. 189 * Any key is pressed.
190 */ 190 */
191 pthread_mutex_lock(&mutexes[LOCK_LCD]); 191 if (Backlight == 0) {
192 setBacklight(1); 192 pthread_mutex_lock(&mutexes[LOCK_LCD]);
193 pthread_mutex_unlock(&mutexes[LOCK_LCD]); 193 setBacklight(1);
194 pthread_mutex_unlock(&mutexes[LOCK_LCD]);
195 }
194 Backlight = LCD_SLEEP; 196 Backlight = LCD_SLEEP;
195 menutimer = 0; 197 menutimer = 0;
196 } else { 198 } else {
197 /* 199 /*
198 * No key pressed. 200 * No key pressed.
212 } 214 }
213 if (Backlight > 0) { 215 if (Backlight > 0) {
214 Backlight--; 216 Backlight--;
215 } 217 }
216 218
217 pthread_mutex_lock(&mutexes[LOCK_MENU]);
218 if (setupmenu != MENU_NONE) { 219 if (setupmenu != MENU_NONE) {
220 pthread_mutex_lock(&mutexes[LOCK_MENU]);
219 if (menutimer < MENU_TIMEOUT) 221 if (menutimer < MENU_TIMEOUT)
220 menutimer++; 222 menutimer++;
221 else { 223 else {
222 setupmenu = MENU_NONE; 224 setupmenu = MENU_NONE;
223 } 225 }
226 pthread_mutex_unlock(&mutexes[LOCK_MENU]);
224 } 227 }
225 pthread_mutex_unlock(&mutexes[LOCK_MENU]);
226 } 228 }
227 } 229 }
228 230
229 /* 231 /*
230 * Loop 10 milliseconds 232 * Loop 10 milliseconds

mercurial