Encapsulate common display code in a singleton (#12395)

* Encapsulate common LCD code in a singleton
* Depend more UBL code on UBL_DEVEL_DEBUGGING
  - Since most users don't need the debugging on at all times, this helps reduce the default build size for UBL by over 2K, a little closer to fitting on 128K boards.
This commit is contained in:
Scott Lahteine
2018-11-11 12:16:24 -06:00
committed by GitHub
parent 9da6809ac3
commit a0c795b097
65 changed files with 1881 additions and 1997 deletions

View File

@ -498,7 +498,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS];
return;
}
lcd_update();
ui.update();
}
disable_all_heaters();
#if ENABLED(PRINTER_EVENT_LEDS)
@ -2123,7 +2123,7 @@ void Temperature::isr() {
// Update lcd buttons 488 times per second
//
static bool do_buttons;
if ((do_buttons ^= true)) lcd_buttons_update();
if ((do_buttons ^= true)) ui.update_buttons();
/**
* One sensor is sampled on every other call of the ISR.
@ -2425,9 +2425,9 @@ void Temperature::isr() {
void Temperature::set_heating_message(const uint8_t e) {
const bool heating = isHeatingHotend(e);
#if HOTENDS > 1
lcd_status_printf_P(0, heating ? PSTR("E%i " MSG_HEATING) : PSTR("E%i " MSG_COOLING), int(e + 1));
ui.status_printf_P(0, heating ? PSTR("E%i " MSG_HEATING) : PSTR("E%i " MSG_COOLING), int(e + 1));
#else
lcd_setstatusPGM(heating ? PSTR("E " MSG_HEATING) : PSTR("E " MSG_COOLING));
ui.setstatusPGM(heating ? PSTR("E " MSG_HEATING) : PSTR("E " MSG_COOLING));
#endif
}
#endif
@ -2530,16 +2530,16 @@ void Temperature::isr() {
}
#if G26_CLICK_CAN_CANCEL
if (click_to_cancel && use_click()) {
if (click_to_cancel && ui.use_click()) {
wait_for_heatup = false;
lcd_quick_feedback();
ui.quick_feedback();
}
#endif
} while (wait_for_heatup && TEMP_CONDITIONS);
if (wait_for_heatup) {
lcd_reset_status();
ui.reset_status();
#if ENABLED(PRINTER_EVENT_LEDS)
printerEventLEDs.onHeatingDone();
#endif
@ -2655,15 +2655,15 @@ void Temperature::isr() {
}
#if G26_CLICK_CAN_CANCEL
if (click_to_cancel && use_click()) {
if (click_to_cancel && ui.use_click()) {
wait_for_heatup = false;
lcd_quick_feedback();
ui.quick_feedback();
}
#endif
} while (wait_for_heatup && TEMP_BED_CONDITIONS);
if (wait_for_heatup) lcd_reset_status();
if (wait_for_heatup) ui.reset_status();
#if DISABLED(BUSY_WHILE_HEATING) && ENABLED(HOST_KEEPALIVE_FEATURE)
gcode.busy_state = old_busy_state;