Skip to content

Commit

Permalink
🐛 Fix ExtUI 'lcd_clicked' definition (MarlinFirmware#22257)
Browse files Browse the repository at this point in the history
  • Loading branch information
slowbro authored and Night69 committed Aug 31, 2021
1 parent 363bdfd commit b7a8bad
Showing 1 changed file with 11 additions and 57 deletions.
68 changes: 11 additions & 57 deletions Marlin/src/lcd/marlinui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ MarlinUI ui;
#endif

#if ENABLED(DWIN_CREALITY_LCD)
#include "e3v2/creality/dwin.h"
#include "dwin/e3v2/dwin.h"
#endif

#if ENABLED(LCD_PROGRESS_BAR) && !IS_TFTGLCD_PANEL
Expand All @@ -65,8 +65,15 @@ MarlinUI ui;
constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;

#if HAS_STATUS_MESSAGE
#if BOTH(HAS_WIRED_LCD, STATUS_MESSAGE_SCROLLING)
uint8_t MarlinUI::status_scroll_offset; // = 0
#if HAS_WIRED_LCD
#if ENABLED(STATUS_MESSAGE_SCROLLING)
uint8_t MarlinUI::status_scroll_offset; // = 0
constexpr uint8_t MAX_MESSAGE_LENGTH = _MAX(LONG_FILENAME_LENGTH, MAX_LANG_CHARSIZE * 2 * (LCD_WIDTH));
#else
constexpr uint8_t MAX_MESSAGE_LENGTH = MAX_LANG_CHARSIZE * (LCD_WIDTH);
#endif
#else
constexpr uint8_t MAX_MESSAGE_LENGTH = 63;
#endif
char MarlinUI::status_message[MAX_MESSAGE_LENGTH + 1];
uint8_t MarlinUI::alert_level; // = 0
Expand All @@ -81,25 +88,6 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;

#if HAS_MULTI_LANGUAGE
uint8_t MarlinUI::language; // Initialized by settings.load()
void MarlinUI::set_language(const uint8_t lang) {
if (lang < NUM_LANGUAGES) {
language = lang;
TERN_(HAS_MARLINUI_U8GLIB, update_language_font());
return_to_status();
refresh();
}
}
#endif

#if HAS_LCD_BRIGHTNESS
uint8_t MarlinUI::brightness = DEFAULT_LCD_BRIGHTNESS;
bool MarlinUI::backlight = true;

void MarlinUI::set_brightness(const uint8_t value) {
backlight = !!value;
if (backlight) brightness = constrain(value, MIN_LCD_BRIGHTNESS, MAX_LCD_BRIGHTNESS);
// Set brightness on enabled LCD here
}
#endif

#if ENABLED(SOUND_MENU_ITEM)
Expand Down Expand Up @@ -712,7 +700,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
* This is used to achieve more rapid stepping on kinematic machines.
*
* Currently used by the _lcd_move_xyz function in menu_motion.cpp
* and the ubl_map_move_to_xy function in menu_ubl.cpp.
* and the ubl_map_move_to_xy funtion in menu_ubl.cpp.
*/
void ManualMove::task() {

Expand Down Expand Up @@ -1673,40 +1661,6 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
}
#endif

#if BOTH(EXTENSIBLE_UI, ADVANCED_PAUSE_FEATURE)

void MarlinUI::pause_show_message(
const PauseMessage message,
const PauseMode mode/*=PAUSE_MODE_SAME*/,
const uint8_t extruder/*=active_extruder*/
) {
if (mode == PAUSE_MODE_SAME)
return;
pause_mode = mode;
switch (message) {
case PAUSE_MESSAGE_PARKING: ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_PAUSE_PRINT_PARKING));
case PAUSE_MESSAGE_CHANGING: ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_FILAMENT_CHANGE_INIT));
case PAUSE_MESSAGE_UNLOAD: ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_FILAMENT_CHANGE_UNLOAD));
case PAUSE_MESSAGE_WAITING: ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_ADVANCED_PAUSE_WAITING));
case PAUSE_MESSAGE_INSERT: ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_FILAMENT_CHANGE_INSERT));
case PAUSE_MESSAGE_LOAD: ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_FILAMENT_CHANGE_LOAD));
case PAUSE_MESSAGE_PURGE:
#if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE)
ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_FILAMENT_CHANGE_CONT_PURGE));
#else
ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_FILAMENT_CHANGE_PURGE));
#endif
case PAUSE_MESSAGE_RESUME: ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_FILAMENT_CHANGE_RESUME));
case PAUSE_MESSAGE_HEAT: ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_FILAMENT_CHANGE_HEAT));
case PAUSE_MESSAGE_HEATING: ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_FILAMENT_CHANGE_HEATING));
case PAUSE_MESSAGE_OPTION: ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_FILAMENT_CHANGE_OPTION_HEADER));
case PAUSE_MESSAGE_STATUS:
default: break;
}
}

#endif

#if ENABLED(EEPROM_SETTINGS)

#if HAS_LCD_MENU
Expand Down

0 comments on commit b7a8bad

Please sign in to comment.