🧑💻 HAS_MARLINUI_MENU, HAS_MANUAL_MOVE_MENU
This commit is contained in:
@@ -155,7 +155,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if EITHER(HAS_LCD_MENU, EXTENSIBLE_UI)
|
||||
#if EITHER(HAS_MARLINUI_MENU, EXTENSIBLE_UI)
|
||||
bool MarlinUI::lcd_clicked;
|
||||
#endif
|
||||
|
||||
@@ -257,7 +257,7 @@ void MarlinUI::init() {
|
||||
#include "../module/planner.h"
|
||||
#include "../module/motion.h"
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
#if HAS_MARLINUI_MENU
|
||||
#include "../module/settings.h"
|
||||
#endif
|
||||
|
||||
@@ -348,7 +348,7 @@ void MarlinUI::init() {
|
||||
|
||||
#endif
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
#if HAS_MARLINUI_MENU
|
||||
#include "menu/menu.h"
|
||||
|
||||
screenFunc_t MarlinUI::currentScreen; // Initialized in CTOR
|
||||
@@ -450,7 +450,7 @@ void MarlinUI::init() {
|
||||
|
||||
#endif // !HAS_GRAPHICAL_TFT
|
||||
|
||||
#endif // HAS_LCD_MENU
|
||||
#endif // HAS_MARLINUI_MENU
|
||||
|
||||
////////////////////////////////////////////
|
||||
///////////// Keypad Handling //////////////
|
||||
@@ -460,7 +460,7 @@ void MarlinUI::init() {
|
||||
|
||||
volatile uint8_t MarlinUI::keypad_buttons;
|
||||
|
||||
#if HAS_LCD_MENU && !HAS_ADC_BUTTONS
|
||||
#if HAS_MARLINUI_MENU && !HAS_ADC_BUTTONS
|
||||
|
||||
void lcd_move_x();
|
||||
void lcd_move_y();
|
||||
@@ -487,7 +487,7 @@ void MarlinUI::init() {
|
||||
if (keypad_buttons) {
|
||||
#if HAS_ENCODER_ACTION
|
||||
refresh(LCDVIEW_REDRAW_NOW);
|
||||
#if HAS_LCD_MENU
|
||||
#if HAS_MARLINUI_MENU
|
||||
if (encoderDirection == -(ENCODERBASE)) { // HAS_ADC_BUTTONS forces REVERSE_MENU_DIRECTION, so this indicates menu navigation
|
||||
if (RRK(EN_KEYPAD_UP)) encoderPosition += ENCODER_STEPS_PER_MENU_ITEM;
|
||||
else if (RRK(EN_KEYPAD_DOWN)) encoderPosition -= ENCODER_STEPS_PER_MENU_ITEM;
|
||||
@@ -497,7 +497,7 @@ void MarlinUI::init() {
|
||||
else
|
||||
#endif
|
||||
{
|
||||
#if HAS_LCD_MENU
|
||||
#if HAS_MARLINUI_MENU
|
||||
if (RRK(EN_KEYPAD_UP)) encoderPosition -= epps;
|
||||
else if (RRK(EN_KEYPAD_DOWN)) encoderPosition += epps;
|
||||
else if (RRK(EN_KEYPAD_LEFT)) { MenuItem_back::action(); quick_feedback(); }
|
||||
@@ -528,7 +528,7 @@ void MarlinUI::init() {
|
||||
|
||||
const bool homed = all_axes_homed();
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
#if HAS_MARLINUI_MENU
|
||||
|
||||
if (RRK(EN_KEYPAD_MIDDLE)) goto_screen(menu_move);
|
||||
|
||||
@@ -547,7 +547,7 @@ void MarlinUI::init() {
|
||||
if (RRK(EN_KEYPAD_UP)) _reprapworld_keypad_move(Y_AXIS, -1);
|
||||
}
|
||||
|
||||
#endif // HAS_LCD_MENU
|
||||
#endif // HAS_MARLINUI_MENU
|
||||
|
||||
if (!homed && RRK(EN_KEYPAD_F1)) queue.inject_P(G28_STR);
|
||||
return true;
|
||||
@@ -575,7 +575,7 @@ void MarlinUI::init() {
|
||||
|
||||
void MarlinUI::status_screen() {
|
||||
|
||||
TERN_(HAS_LCD_MENU, ENCODER_RATE_MULTIPLY(false));
|
||||
TERN_(HAS_MARLINUI_MENU, ENCODER_RATE_MULTIPLY(false));
|
||||
|
||||
#if BASIC_PROGRESS_BAR
|
||||
|
||||
@@ -619,7 +619,7 @@ void MarlinUI::init() {
|
||||
|
||||
#endif // BASIC_PROGRESS_BAR
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
#if HAS_MARLINUI_MENU
|
||||
if (use_click()) {
|
||||
#if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT)
|
||||
next_filament_display = millis() + 5000UL; // Show status message for 5s
|
||||
@@ -673,7 +673,7 @@ void MarlinUI::init() {
|
||||
void MarlinUI::kill_screen(FSTR_P const lcd_error, FSTR_P const lcd_component) {
|
||||
init();
|
||||
status_printf(1, F(S_FMT ": " S_FMT), FTOP(lcd_error), FTOP(lcd_component));
|
||||
TERN_(HAS_LCD_MENU, return_to_status());
|
||||
TERN_(HAS_MARLINUI_MENU, return_to_status());
|
||||
|
||||
// RED ALERT. RED ALERT.
|
||||
#ifdef LED_BACKLIGHT_TIMEOUT
|
||||
@@ -701,7 +701,7 @@ void MarlinUI::init() {
|
||||
|
||||
void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) {
|
||||
TERN_(HAS_TOUCH_SLEEP, wakeup_screen()); // Wake up the TFT with most buttons
|
||||
TERN_(HAS_LCD_MENU, refresh());
|
||||
TERN_(HAS_MARLINUI_MENU, refresh());
|
||||
|
||||
#if HAS_ENCODER_ACTION
|
||||
if (clear_buttons) buttons = 0;
|
||||
@@ -712,9 +712,9 @@ void MarlinUI::init() {
|
||||
|
||||
#if HAS_CHIRP
|
||||
chirp(); // Buzz and wait. Is the delay needed for buttons to settle?
|
||||
#if BOTH(HAS_LCD_MENU, USE_BEEPER)
|
||||
#if BOTH(HAS_MARLINUI_MENU, USE_BEEPER)
|
||||
for (int8_t i = 5; i--;) { buzzer.tick(); delay(2); }
|
||||
#elif HAS_LCD_MENU
|
||||
#elif HAS_MARLINUI_MENU
|
||||
delay(10);
|
||||
#endif
|
||||
#endif
|
||||
@@ -724,7 +724,7 @@ void MarlinUI::init() {
|
||||
/////////////// Manual Move ////////////////
|
||||
////////////////////////////////////////////
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
#if HAS_MARLINUI_MENU
|
||||
|
||||
ManualMove MarlinUI::manual_move{};
|
||||
|
||||
@@ -836,7 +836,7 @@ void MarlinUI::init() {
|
||||
|
||||
#endif
|
||||
|
||||
#endif // HAS_LCD_MENU
|
||||
#endif // HAS_MARLINUI_MENU
|
||||
|
||||
/**
|
||||
* Update the LCD, read encoder buttons, etc.
|
||||
@@ -887,7 +887,7 @@ void MarlinUI::init() {
|
||||
leds.update_timeout(powerManager.psu_on);
|
||||
#endif
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
#if HAS_MARLINUI_MENU
|
||||
|
||||
// Handle any queued Move Axis motion
|
||||
manual_move.task();
|
||||
@@ -942,7 +942,7 @@ void MarlinUI::init() {
|
||||
goto_previous_screen();
|
||||
}
|
||||
|
||||
#endif // HAS_LCD_MENU
|
||||
#endif // HAS_MARLINUI_MENU
|
||||
|
||||
if (ELAPSED(ms, next_lcd_update_ms) || TERN0(HAS_MARLINUI_U8GLIB, drawing_screen)) {
|
||||
|
||||
@@ -989,7 +989,7 @@ void MarlinUI::init() {
|
||||
if (encoderPastThreshold || lcd_clicked) {
|
||||
if (encoderPastThreshold && TERN1(IS_TFTGLCD_PANEL, !external_control)) {
|
||||
|
||||
#if BOTH(HAS_LCD_MENU, ENCODER_RATE_MULTIPLIER)
|
||||
#if BOTH(HAS_MARLINUI_MENU, ENCODER_RATE_MULTIPLIER)
|
||||
|
||||
int32_t encoderMultiplier = 1;
|
||||
|
||||
@@ -1049,7 +1049,7 @@ void MarlinUI::init() {
|
||||
refresh(LCDVIEW_REDRAW_NOW);
|
||||
}
|
||||
|
||||
#if BOTH(HAS_LCD_MENU, SCROLL_LONG_FILENAMES)
|
||||
#if BOTH(HAS_MARLINUI_MENU, SCROLL_LONG_FILENAMES)
|
||||
// If scrolling of long file names is enabled and we are in the sd card menu,
|
||||
// cause a refresh to occur until all the text has scrolled into view.
|
||||
if (currentScreen == menu_media && !lcd_status_update_delay--) {
|
||||
@@ -1120,7 +1120,7 @@ void MarlinUI::init() {
|
||||
|
||||
#endif
|
||||
|
||||
TERN_(HAS_LCD_MENU, lcd_clicked = false);
|
||||
TERN_(HAS_MARLINUI_MENU, lcd_clicked = false);
|
||||
|
||||
// Keeping track of the longest time for an individual LCD update.
|
||||
// Used to do screen throttling when the planner starts to fill up.
|
||||
@@ -1334,7 +1334,7 @@ void MarlinUI::init() {
|
||||
case ENCODER_PHASE_2: ENCODER_SPIN(ENCODER_PHASE_1, ENCODER_PHASE_3); break;
|
||||
case ENCODER_PHASE_3: ENCODER_SPIN(ENCODER_PHASE_2, ENCODER_PHASE_0); break;
|
||||
}
|
||||
#if BOTH(HAS_LCD_MENU, AUTO_BED_LEVELING_UBL)
|
||||
#if BOTH(HAS_MARLINUI_MENU, AUTO_BED_LEVELING_UBL)
|
||||
external_encoder();
|
||||
#endif
|
||||
lastEncoderBits = enc;
|
||||
@@ -1460,7 +1460,7 @@ void MarlinUI::init() {
|
||||
void MarlinUI::set_alert_status(FSTR_P const fstr) {
|
||||
set_status(fstr, 1);
|
||||
TERN_(HAS_TOUCH_SLEEP, wakeup_screen());
|
||||
TERN_(HAS_LCD_MENU, return_to_status());
|
||||
TERN_(HAS_MARLINUI_MENU, return_to_status());
|
||||
}
|
||||
|
||||
#include <stdarg.h>
|
||||
@@ -1545,10 +1545,10 @@ void MarlinUI::init() {
|
||||
IF_DISABLED(SDSUPPORT, print_job_timer.stop());
|
||||
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_open(PROMPT_INFO, F("UI Aborted"), FPSTR(DISMISS_STR)));
|
||||
LCD_MESSAGE(MSG_PRINT_ABORTED);
|
||||
TERN_(HAS_LCD_MENU, return_to_status());
|
||||
TERN_(HAS_MARLINUI_MENU, return_to_status());
|
||||
}
|
||||
|
||||
#if BOTH(HAS_LCD_MENU, PSU_CONTROL)
|
||||
#if BOTH(HAS_MARLINUI_MENU, PSU_CONTROL)
|
||||
|
||||
void MarlinUI::poweroff() {
|
||||
queue.inject(F("M81" TERN_(POWER_OFF_WAIT_FOR_COOLDOWN, "S")));
|
||||
@@ -1560,11 +1560,11 @@ void MarlinUI::init() {
|
||||
void MarlinUI::flow_fault() {
|
||||
LCD_ALERTMESSAGE(MSG_FLOWMETER_FAULT);
|
||||
TERN_(HAS_BUZZER, buzz(1000, 440));
|
||||
TERN_(HAS_LCD_MENU, return_to_status());
|
||||
TERN_(HAS_MARLINUI_MENU, return_to_status());
|
||||
}
|
||||
|
||||
void MarlinUI::pause_print() {
|
||||
#if HAS_LCD_MENU
|
||||
#if HAS_MARLINUI_MENU
|
||||
synchronize(GET_TEXT(MSG_PAUSING));
|
||||
defer_status_screen();
|
||||
#endif
|
||||
@@ -1686,7 +1686,7 @@ void MarlinUI::init() {
|
||||
ExtUI::onMediaRemoved();
|
||||
#elif PIN_EXISTS(SD_DETECT)
|
||||
LCD_MESSAGE(MSG_MEDIA_REMOVED);
|
||||
#if HAS_LCD_MENU
|
||||
#if HAS_MARLINUI_MENU
|
||||
if (!defer_return_to_status) return_to_status();
|
||||
#endif
|
||||
#endif
|
||||
@@ -1712,7 +1712,7 @@ void MarlinUI::init() {
|
||||
|
||||
#endif // SDSUPPORT
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
#if HAS_MARLINUI_MENU
|
||||
void MarlinUI::reset_settings() {
|
||||
settings.reset();
|
||||
completion_feedback();
|
||||
@@ -1768,7 +1768,7 @@ void MarlinUI::init() {
|
||||
|
||||
#if ENABLED(EEPROM_SETTINGS)
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
#if HAS_MARLINUI_MENU
|
||||
void MarlinUI::init_eeprom() {
|
||||
const bool good = settings.init_eeprom();
|
||||
completion_feedback(good);
|
||||
@@ -1796,7 +1796,7 @@ void MarlinUI::init() {
|
||||
}
|
||||
|
||||
void MarlinUI::eeprom_alert(const uint8_t msgid) {
|
||||
#if HAS_LCD_MENU
|
||||
#if HAS_MARLINUI_MENU
|
||||
editable.uint8 = msgid;
|
||||
goto_screen([]{
|
||||
PGM_P const restore_msg = GET_TEXT(MSG_INIT_EEPROM);
|
||||
|
Reference in New Issue
Block a user