Fixed stepping down in LCD screens.

Wed, 13 Aug 2014 19:14:01 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Wed, 13 Aug 2014 19:14:01 +0200
changeset 228
11655e7124c5
parent 227
1cb55ea51f76
child 229
5f93b61adb34

Fixed stepping down in LCD screens.

thermferm/lcd-buffer.c file | annotate | diff | comparison | revisions
thermferm/panel.c file | annotate | diff | comparison | revisions
--- a/thermferm/lcd-buffer.c	Wed Aug 13 17:37:59 2014 +0200
+++ b/thermferm/lcd-buffer.c	Wed Aug 13 19:14:01 2014 +0200
@@ -92,15 +92,15 @@
 {
     if (key == KEY_DOWN) {
 	if (current_offset < (current_lines - Config.lcd_rows))
-	    current_offset = current_offset + Config.lcd_rows;
+	    current_offset += Config.lcd_rows;
 	else
 	    current_offset = 0;
 	syslog(LOG_NOTICE, "lcd_buf_step(KEY_DOWN) current_lines=%d current_offset=%d", current_lines, current_offset);
 	lcd_buf_show();
     }
     if (key == KEY_UP) {
-	if (current_offset > Config.lcd_rows)
-	    current_offset = current_offset - Config.lcd_rows;
+	if (current_offset >= Config.lcd_rows)
+	    current_offset -= Config.lcd_rows;
 	else
 	    current_offset = (current_lines - Config.lcd_rows);
 	syslog(LOG_NOTICE, "lcd_buf_step(KEY_UP) current_lines=%d current_offset=%d", current_lines, current_offset);
--- a/thermferm/panel.c	Wed Aug 13 17:37:59 2014 +0200
+++ b/thermferm/panel.c	Wed Aug 13 19:14:01 2014 +0200
@@ -137,8 +137,7 @@
 	    /*
 	     * Any key is pressed.
 	     */
-//	    if (Backlight == 0)
-		setBacklight(1);
+	    setBacklight(1);
 	    Backlight = LCD_SLEEP;
 	    menutimer = 0;
 	} else {

mercurial