浏览代码

added confirm character for messages which waits for user to press the knob

PavelSindler 7 年之前
父节点
当前提交
827a9ce6cb
共有 2 个文件被更改,包括 33 次插入8 次删除
  1. 23 8
      Firmware/ultralcd.cpp
  2. 10 0
      Firmware/ultralcd_implementation_hitachi_HD44780.h

+ 23 - 8
Firmware/ultralcd.cpp

@@ -2096,13 +2096,13 @@ const char* lcd_display_message_fullscreen_P(const char *msg, uint8_t &nlines)
     }
 
     if (multi_screen) {
-        // Display the "next screen" indicator character.
-        // lcd_set_custom_characters_arrows();
-        lcd_set_custom_characters_nextpage();
-        lcd.setCursor(19, 3);
+		// Display the "next screen" indicator character.
+		// lcd_set_custom_characters_arrows();
+		lcd_set_custom_characters_nextpage();
+		lcd.setCursor(19, 3);
         // Display the down arrow.
         lcd.print(char(1));
-    }
+	}
 
     nlines = row;
     return multi_screen ? msgend : NULL;
@@ -2123,15 +2123,30 @@ void lcd_show_fullscreen_message_and_wait_P(const char *msg)
                 while (lcd_clicked()) ;
                 delay(10);
                 while (lcd_clicked()) ;
+				lcd_set_custom_characters();
+				lcd_update_enable(true);
+				lcd_update(2);
 				KEEPALIVE_STATE(IN_HANDLER);
                 return;
             }
         }
         if (multi_screen) {
-            if (msg_next == NULL)
-                msg_next = msg;
+			if (msg_next == NULL) 
+				msg_next = msg;
             msg_next = lcd_display_message_fullscreen_P(msg_next);
-        }
+			if (msg_next == NULL) {
+				lcd_set_custom_characters_nextpage();
+				lcd.setCursor(19, 3);
+				// Display the confirm char.
+				lcd.print(char(2));
+			}
+		}
+		else {
+			lcd_set_custom_characters_nextpage();
+			lcd.setCursor(19, 3);
+			// Display the confirm char.
+			lcd.print(char(2));
+		}
     }
 }
 

+ 10 - 0
Firmware/ultralcd_implementation_hitachi_HD44780.h

@@ -491,8 +491,18 @@ void lcd_set_custom_characters_nextpage()
     B01010,
     B00100
   }; 
+  byte confirm[8] = {
+	B00000,
+	B00001,
+	B00011,
+	B10110,
+	B11100,
+	B01000,
+	B00000
+  };
 
     lcd.createChar(1, arrdown);
+	lcd.createChar(2, confirm);
 }
 
 void lcd_set_custom_characters_degree()