Followup to Menu Refactor (#12275)

This commit is contained in:
Scott Lahteine
2018-10-30 16:34:45 -05:00
committed by GitHub
parent 5536228359
commit 3583e2b449
45 changed files with 244 additions and 273 deletions

View File

@ -22,7 +22,7 @@
#include "../../inc/MarlinConfigPre.h"
#if ENABLED(ULTIPANEL)
#if HAS_LCD_MENU
#include "menu.h"
#include "../ultralcd.h"
@ -75,8 +75,6 @@ bool no_reentry = false;
//////// Menu Navigation & History /////////
////////////////////////////////////////////
void lcd_status_screen();
void lcd_return_to_status() { lcd_goto_screen(lcd_status_screen); }
void lcd_save_previous_screen() {
@ -203,14 +201,6 @@ void menu_action_setting_edit_callback_bool(PGM_P pstr, bool* ptr, screenFunc_t
bool printer_busy() { return planner.movesplanned() || IS_SD_PRINTING(); }
#if HAS_CHARACTER_LCD && (ENABLED(LCD_PROGRESS_BAR) || ENABLED(LCD_PROGRESS_BAR_TEST) || ENABLED(AUTO_BED_LEVELING_UBL))
void lcd_set_custom_characters(
#if ENABLED(LCD_PROGRESS_BAR) || ENABLED(SHOW_BOOTSCREEN)
const uint8_t screen_charset=CHARSET_INFO
#endif
);
#endif
/**
* General function to go directly to a screen
*/
@ -258,19 +248,17 @@ void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder/*=0*/) {
#endif
screen_history_depth = 0;
}
lcd_implementation_clear();
// Re-initialize custom characters that may be re-used
#if HAS_CHARACTER_LCD && ENABLED(AUTO_BED_LEVELING_UBL)
if (!ubl.lcd_map_control) {
lcd_set_custom_characters(
#if ENABLED(LCD_PROGRESS_BAR)
screen == lcd_status_screen ? CHARSET_INFO : CHARSET_MENU
#endif
);
}
#elif ENABLED(LCD_PROGRESS_BAR)
lcd_set_custom_characters(screen == lcd_status_screen ? CHARSET_INFO : CHARSET_MENU);
#if HAS_CHARACTER_LCD
#if ENABLED(AUTO_BED_LEVELING_UBL)
if (!ubl.lcd_map_control)
#endif
LCD_SET_CHARSET(screen == lcd_status_screen ? CHARSET_INFO : CHARSET_MENU);
#endif
lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT;
screen_changed = true;
#if HAS_GRAPHICAL_LCD
@ -476,4 +464,4 @@ void _lcd_draw_homing() {
void _lcd_toggle_bed_leveling() { set_bed_leveling_enabled(!planner.leveling_active); }
#endif
#endif // ULTIPANEL
#endif // HAS_LCD_MENU

View File

@ -54,7 +54,7 @@ static void lcd_factory_settings() {
static int8_t bar_percent = 0;
if (use_click()) {
lcd_goto_previous_menu();
lcd_set_custom_characters(CHARSET_MENU);
LCD_SET_CHARSET(CHARSET_MENU);
return;
}
bar_percent += (int8_t)encoderPosition;
@ -68,7 +68,7 @@ static void lcd_factory_settings() {
void _progress_bar_test() {
lcd_goto_screen(progress_bar_test);
lcd_set_custom_characters();
LCD_SET_CHARSET(CHARSET_INFO);
}
#endif // LCD_PROGRESS_BAR_TEST