From 827a9ce6cb7e73b50da75e44c30b159c87260e65 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Wed, 13 Sep 2017 15:41:19 +0200 Subject: [PATCH] added confirm character for messages which waits for user to press the knob --- Firmware/ultralcd.cpp | 31 ++++++++++++++----- .../ultralcd_implementation_hitachi_HD44780.h | 10 ++++++ 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index a839e753f..d2bcc13da 100644 --- a/Firmware/ultralcd.cpp +++ b/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)); + } } } diff --git a/Firmware/ultralcd_implementation_hitachi_HD44780.h b/Firmware/ultralcd_implementation_hitachi_HD44780.h index ec360c626..f880da88c 100644 --- a/Firmware/ultralcd_implementation_hitachi_HD44780.h +++ b/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()