Skip to content

Commit 466282f

Browse files
authored
🩹 Misc. changes from ProUI / ExtUI updates (MarlinFirmware#26928)
1 parent 1759429 commit 466282f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+363
-244
lines changed

Marlin/src/feature/leds/printer_event_leds.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class PrinterEventLEDs {
5656

5757
#if HAS_TEMP_HOTEND || HAS_HEATED_BED || HAS_HEATED_CHAMBER
5858
static void onHeatingDone() { leds.set_white(); }
59-
static void onPidTuningDone(LEDColor c) { leds.set_color(c); }
59+
static void onPIDTuningDone(LEDColor c) { leds.set_color(c); }
6060
#endif
6161

6262
#if HAS_MEDIA

Marlin/src/feature/pause.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,14 @@ enum PauseMessage : char {
5252
PAUSE_MESSAGE_RESUME,
5353
PAUSE_MESSAGE_HEAT,
5454
PAUSE_MESSAGE_HEATING,
55-
PAUSE_MESSAGE_STATUS
55+
PAUSE_MESSAGE_STATUS,
56+
PAUSE_MESSAGE_COUNT
5657
};
5758

5859
#if M600_PURGE_MORE_RESUMABLE
60+
/**
61+
* Input methods can Purge More, Resume, or request input
62+
*/
5963
enum PauseMenuResponse : char {
6064
PAUSE_RESPONSE_WAIT_FOR,
6165
PAUSE_RESPONSE_EXTRUDE_MORE,

Marlin/src/gcode/temp/M303.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ void GcodeSuite::M303() {
6868
default:
6969
SERIAL_ECHOPGM(STR_PID_AUTOTUNE);
7070
SERIAL_ECHOLNPGM(STR_PID_BAD_HEATER_ID);
71-
TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_BAD_HEATER_ID));
71+
TERN_(EXTENSIBLE_UI, ExtUI::onPIDTuning(ExtUI::result_t::PID_BAD_HEATER_ID));
7272
TERN_(PROUI_PID_TUNE, dwinPidTuning(PID_BAD_HEATER_ID));
7373
return;
7474
}

Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ void ST7920_Lite_Status_Screen::update_status_or_position(bool forceUpdate) {
886886
* If STATUS_EXPIRE_SECONDS is zero, only the status is shown.
887887
*/
888888
if (forceUpdate || status_changed()) {
889-
TERN_(STATUS_MESSAGE_SCROLLING, ui.status_scroll_offset = 0);
889+
TERN_(STATUS_MESSAGE_SCROLLING, ui.reset_status_scroll());
890890
#if STATUS_EXPIRE_SECONDS
891891
countdown = !ui.status_message.empty() ? STATUS_EXPIRE_SECONDS : 0;
892892
#endif

Marlin/src/lcd/e3v2/common/dwin_api.h

+6
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323

2424
#include "../../../inc/MarlinConfig.h"
2525

26+
//
27+
// e3v2/common/dwin_api.h
28+
//
29+
// Included by: e3v2/*/dwin_lcd.h
30+
//
31+
2632
#if ENABLED(DWIN_MARLINUI_LANDSCAPE)
2733
#define DWIN_WIDTH 480
2834
#define DWIN_HEIGHT 272

Marlin/src/lcd/e3v2/common/dwin_font.h

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
*/
2222
#pragma once
2323

24+
#include <stdint.h>
25+
2426
typedef uint8_t fontid_t;
2527

2628
/**

Marlin/src/lcd/e3v2/creality/dwin.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -1822,8 +1822,6 @@ void MarlinUI::update() {
18221822
dwinHandleScreen(); // Rotary encoder update
18231823
}
18241824

1825-
void MarlinUI::refresh() { /* Nothing to see here */ }
1826-
18271825
#if HAS_LCD_BRIGHTNESS
18281826
void MarlinUI::_set_brightness() { dwinLCDBrightness(backlight ? brightness : 0); }
18291827
#endif

Marlin/src/lcd/e3v2/jyersui/dwin.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -5158,6 +5158,7 @@ void MarlinUI::init_lcd() {
51585158

51595159
#if ENABLED(ADVANCED_PAUSE_FEATURE)
51605160
void MarlinUI::pause_show_message(const PauseMessage message, const PauseMode mode/*=PAUSE_MODE_SAME*/, const uint8_t extruder/*=active_extruder*/) {
5161+
if (mode != PAUSE_MODE_SAME) pause_mode = mode;
51615162
switch (message) {
51625163
case PAUSE_MESSAGE_INSERT: jyersDWIN.confirmHandler(Popup_FilInsert); break;
51635164
case PAUSE_MESSAGE_PURGE:

Marlin/src/lcd/e3v2/marlinui/dwin_lcd.h

-4
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,3 @@
7676
#include "../common/dwin_color.h"
7777

7878
#define Color_Bg_Heading 0x3344 // Static Heading
79-
80-
// Character matrix width x height
81-
//#define LCD_WIDTH ((DWIN_WIDTH) / 8)
82-
//#define LCD_HEIGHT ((DWIN_HEIGHT) / 12)

Marlin/src/lcd/e3v2/marlinui/marlinui_dwin.h

+6
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ extern dwin_font_t dwin_font;
7272
#define EXTRA_ROW_HEIGHT 8
7373
#define MENU_LINE_HEIGHT (MENU_FONT_HEIGHT + EXTRA_ROW_HEIGHT)
7474

75+
// Character matrix width x height based on menu font
76+
#define LCD_PIXEL_WIDTH DWIN_WIDTH
77+
#define LCD_PIXEL_HEIGHT DWIN_HEIGHT
78+
#define LCD_WIDTH ((LCD_PIXEL_WIDTH) / (MENU_FONT_WIDTH))
79+
#define LCD_HEIGHT ((LCD_PIXEL_HEIGHT) / (MENU_LINE_HEIGHT))
80+
7581
#if DWIN_FONT_EDIT == font6x12
7682
#define EDIT_FONT_WIDTH 6
7783
#define EDIT_FONT_ASCENT 10

Marlin/src/lcd/e3v2/marlinui/ui_common.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ void MarlinUI::draw_status_message(const bool blink) {
219219
const char *stat = status_and_len(rlen);
220220
lcd_put_u8str_max(stat, max_status_chars);
221221

222-
// If the string doesn't completely fill the line...
222+
// If the remaining string doesn't completely fill the line...
223223
if (rlen < max_status_chars) {
224224
lcd_put_u8str(F(".")); // Always at 1+ spaces left, draw a dot
225225
uint8_t chars = max_status_chars - rlen; // Amount of space left in characters

Marlin/src/lcd/e3v2/proui/dwin.cpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -1890,8 +1890,6 @@ void MarlinUI::update() {
18901890
dwinHandleScreen(); // Rotary encoder update
18911891
}
18921892

1893-
void MarlinUI::refresh() { /* Nothing to see here */ }
1894-
18951893
#if HAS_LCD_BRIGHTNESS
18961894
void MarlinUI::_set_brightness() { dwinLCDBrightness(backlight ? brightness : 0); }
18971895
#endif
@@ -1928,8 +1926,7 @@ void dwinRedrawScreen() {
19281926
}
19291927

19301928
void MarlinUI::pause_show_message(const PauseMessage message, const PauseMode mode/*=PAUSE_MODE_SAME*/, const uint8_t extruder/*=active_extruder*/) {
1931-
//if (mode == PAUSE_MODE_SAME) return;
1932-
pause_mode = mode;
1929+
if (mode != PAUSE_MODE_SAME) pause_mode = mode;
19331930
switch (message) {
19341931
case PAUSE_MESSAGE_PARKING: dwinPopupPause(GET_TEXT_F(MSG_PAUSE_PRINT_PARKING)); break; // M125
19351932
case PAUSE_MESSAGE_CHANGING: dwinPopupPause(GET_TEXT_F(MSG_FILAMENT_CHANGE_INIT)); break; // pause_print (M125, M600)

Marlin/src/lcd/e3v2/proui/dwin_defines.h

+12-2
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,23 @@
7979
#if CASELIGHT_USES_BRIGHTNESS
8080
#define defCaseLightBrightness 255
8181
#endif
82+
8283
#ifdef Z_AFTER_HOMING
8384
#define DEF_Z_AFTER_HOMING Z_AFTER_HOMING
8485
#else
8586
#define DEF_Z_AFTER_HOMING 0
8687
#endif
87-
#define DEF_HOTENDPIDT TERN(PREHEAT_1_TEMP_BED, PREHEAT_1_TEMP_HOTEND, 195)
88-
#define DEF_BEDPIDT TERN(PREHEAT_1_TEMP_BED, PREHEAT_1_TEMP_HOTEND, 60)
88+
89+
#ifdef PREHEAT_1_TEMP_HOTEND
90+
#define DEF_HOTENDPIDT PREHEAT_1_TEMP_HOTEND
91+
#else
92+
#define DEF_HOTENDPIDT 195
93+
#endif
94+
#ifdef PREHEAT_1_TEMP_BED
95+
#define DEF_BEDPIDT PREHEAT_1_TEMP_BED
96+
#else
97+
#define DEF_BEDPIDT 60
98+
#endif
8999
#define DEF_PIDCYCLES 5
90100

91101
/**

Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp

+7-5
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,14 @@ namespace ExtUI {
5858
void onPrintTimerStarted() { chiron.timerEvent(AC_timer_started); }
5959
void onPrintTimerPaused() { chiron.timerEvent(AC_timer_paused); }
6060
void onPrintTimerStopped() { chiron.timerEvent(AC_timer_stopped); }
61+
6162
void onPrintDone() {}
6263

63-
void onFilamentRunout(const extruder_t) { chiron.filamentRunout(); }
64+
void onFilamentRunout(const extruder_t) { chiron.filamentRunout(); }
65+
66+
void onUserConfirmRequired(const char * const msg) { chiron.confirmationRequest(msg); }
6467

65-
void onUserConfirmRequired(const char * const msg) { chiron.confirmationRequest(msg); }
66-
void onStatusChanged(const char * const msg) { chiron.statusChange(msg); }
68+
void onStatusChanged(const char * const msg) { chiron.statusChange(msg); }
6769

6870
void onHomingStart() {}
6971
void onHomingDone() {}
@@ -133,13 +135,13 @@ namespace ExtUI {
133135
#endif
134136

135137
#if HAS_PID_HEATING
136-
void onPidTuning(const result_t rst) {
138+
void onPIDTuning(const result_t rst) {
137139
// Called for temperature PID tuning result
138140
}
139141
#endif
140142

141143
void onSteppersDisabled() {}
142-
void onSteppersEnabled() {}
144+
void onSteppersEnabled() {}
143145
}
144146

145147
#endif // ANYCUBIC_LCD_CHIRON

Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,26 @@ namespace ExtUI {
3838
void onStartup() { anycubicTFT.onSetup(); }
3939
void onIdle() { anycubicTFT.onCommandScan(); }
4040
void onPrinterKilled(FSTR_P const error, FSTR_P const component) { anycubicTFT.onKillTFT(); }
41+
4142
void onMediaInserted() { anycubicTFT.onSDCardStateChange(true); }
4243
void onMediaError() { anycubicTFT.onSDCardError(); }
4344
void onMediaRemoved() { anycubicTFT.onSDCardStateChange(false); }
45+
4446
void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) {
4547
TERN_(SPEAKER, ::tone(BEEPER_PIN, frequency, duration));
4648
}
4749
void onPrintTimerStarted() { anycubicTFT.onPrintTimerStarted(); }
4850
void onPrintTimerPaused() { anycubicTFT.onPrintTimerPaused(); }
4951
void onPrintTimerStopped() { anycubicTFT.onPrintTimerStopped(); }
52+
5053
void onFilamentRunout(const extruder_t extruder) { anycubicTFT.onFilamentRunout(); }
5154
void onUserConfirmRequired(const char * const msg) { anycubicTFT.onUserConfirmRequired(msg); }
55+
5256
void onStatusChanged(const char * const msg) {}
5357

5458
void onHomingStart() {}
5559
void onHomingDone() {}
60+
5661
void onPrintDone() {}
5762

5863
void onFactoryReset() {}
@@ -119,13 +124,13 @@ namespace ExtUI {
119124
#endif
120125

121126
#if HAS_PID_HEATING
122-
void onPidTuning(const result_t rst) {
127+
void onPIDTuning(const result_t rst) {
123128
// Called for temperature PID tuning result
124129
}
125130
#endif
126131

127132
void onSteppersDisabled() {}
128-
void onSteppersEnabled() {}
133+
void onSteppersEnabled() {}
129134
}
130135

131136
#endif // ANYCUBIC_LCD_I3MEGA

Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ void AnycubicTFT::handleSpecialMenu() {
283283
break;
284284

285285
case '9': // "<09HtBedPID>"
286-
SERIAL_ECHOLNPGM("Special Menu: ", F("Auto Tune Hotbed Pid"));
286+
SERIAL_ECHOLNPGM("Special Menu: ", F("Auto Tune Hotbed PID"));
287287
injectCommands(F("M303 E-1 S65 C6 U1"));
288288
break;
289289
}
@@ -328,7 +328,7 @@ void AnycubicTFT::handleSpecialMenu() {
328328
break;
329329

330330
case '4': // "<04HtbedPID>"
331-
SERIAL_ECHOLNPGM("Special Menu: ", F("Auto Tune Hotbed Pid"));
331+
SERIAL_ECHOLNPGM("Special Menu: ", F("Auto Tune Hotbed PID"));
332332
injectCommands(F("M303 E-1 S65 C6 U1"));
333333
break;
334334

@@ -822,8 +822,8 @@ void AnycubicTFT::getCommandFromTFT() {
822822

823823
case 25: // A25 cool down
824824
if (!isPrinting()) {
825-
setTargetTemp_celsius(0, (heater_t) BED);
826-
setTargetTemp_celsius(0, (extruder_t) E0);
825+
setTargetTemp_celsius(0, (heater_t)BED);
826+
setTargetTemp_celsius(0, (extruder_t)E0);
827827

828828
SENDLINE_DBG_PGM("J12", "TFT Serial Debug: Cooling down... J12"); // J12 cool down
829829
}

Marlin/src/lcd/extui/anycubic_vyper/vyper_extui.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,14 @@ namespace ExtUI {
5858
void onPrintTimerStarted() { dgus.timerEvent(AC_timer_started); }
5959
void onPrintTimerPaused() { dgus.timerEvent(AC_timer_paused); }
6060
void onPrintTimerStopped() { dgus.timerEvent(AC_timer_stopped); }
61+
6162
void onPrintDone() {}
6263

63-
void onFilamentRunout(const extruder_t) { dgus.filamentRunout(); }
64+
void onFilamentRunout(const extruder_t) { dgus.filamentRunout(); }
6465

6566
void onUserConfirmRequired(const char * const msg) { dgus.confirmationRequest(msg); }
66-
void onStatusChanged(const char * const msg) { dgus.statusChange(msg); }
67+
68+
void onStatusChanged(const char * const msg) { dgus.statusChange(msg); }
6769

6870
void onHomingStart() { dgus.homingStart(); }
6971
void onHomingDone() { dgus.homingComplete(); }
@@ -135,7 +137,7 @@ namespace ExtUI {
135137
#endif
136138

137139
#if HAS_PID_HEATING
138-
void onPidTuning(const result_t rst) {
140+
void onPIDTuning(const result_t rst) {
139141
// Called for temperature PID tuning result
140142
switch (rst) {
141143
case PID_STARTED: break;
@@ -148,7 +150,7 @@ namespace ExtUI {
148150
#endif
149151

150152
void onSteppersDisabled() {}
151-
void onSteppersEnabled() {}
153+
void onSteppersEnabled() {}
152154
}
153155

154156
#endif // ANYCUBIC_LCD_VYPER

Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void (*DGUSScreenHandler::confirm_action_cb)() = nullptr;
6262
filament_data_t filament_data;
6363
#endif
6464

65-
void DGUSScreenHandler::sendInfoScreen(PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool l4inflash) {
65+
void DGUSScreenHandler::sendInfoScreen_P(PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool l4inflash) {
6666
DGUS_VP_Variable ramcopy;
6767
if (populate_VPVar(VP_MSGSTR1, &ramcopy)) {
6868
ramcopy.memadr = (void*) line1;
@@ -89,7 +89,7 @@ void DGUSScreenHandler::handleUserConfirmationPopUp(uint16_t VP, PGM_P const lin
8989
popToOldScreen();
9090

9191
confirmVP = VP;
92-
sendInfoScreen(line1, line2, line3, line4, l1, l2, l3, l4);
92+
sendInfoScreen_P(line1, line2, line3, line4, l1, l2, l3, l4);
9393
gotoScreen(DGUS_SCREEN_CONFIRM);
9494
}
9595

Marlin/src/lcd/extui/dgus/DGUSScreenHandlerBase.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ class DGUSScreenHandler {
3737

3838
// Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen
3939
// The bools specifying whether the strings are in RAM or FLASH.
40-
static void sendInfoScreen(PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash);
40+
static void sendInfoScreen_P(PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash);
4141
static void sendInfoScreen(FSTR_P const line1, FSTR_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) {
42-
sendInfoScreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash);
42+
sendInfoScreen_P(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash);
4343
}
4444
static void sendInfoScreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) {
45-
sendInfoScreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash);
45+
sendInfoScreen_P(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash);
4646
}
4747

4848
static void handleUserConfirmationPopUp(uint16_t confirmVP, PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash);

Marlin/src/lcd/extui/dgus/dgus_extui.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ namespace ExtUI {
7474

7575
void onHomingStart() {}
7676
void onHomingDone() {}
77+
7778
void onPrintDone() {}
7879

7980
void onFactoryReset() {}
@@ -141,10 +142,11 @@ namespace ExtUI {
141142
#endif
142143

143144
#if HAS_PID_HEATING
144-
void onPidTuning(const result_t rst) {
145+
void onPIDTuning(const result_t rst) {
145146
// Called for temperature PID tuning result
146147
switch (rst) {
147148
case PID_STARTED:
149+
case PID_BED_STARTED:
148150
screen.setStatusMessage(GET_TEXT_F(MSG_PID_AUTOTUNE));
149151
break;
150152
case PID_BAD_HEATER_ID:
@@ -165,7 +167,7 @@ namespace ExtUI {
165167
#endif
166168

167169
void onSteppersDisabled() {}
168-
void onSteppersEnabled() {}
170+
void onSteppersEnabled() {}
169171
}
170172

171173
#endif // HAS_DGUS_LCD_CLASSIC

Marlin/src/lcd/extui/dgus_e3s1pro/dgus_e3s1pro_extui.cpp

+6-10
Original file line numberDiff line numberDiff line change
@@ -117,19 +117,15 @@ namespace ExtUI {
117117
screen.configurationStoreRead(success);
118118
}
119119

120-
#if HAS_MESH
121-
void onLevelingStart() {
122-
screen.levelingStart();
123-
}
124-
125-
void onLevelingDone() {
126-
screen.levelingEnd();
127-
}
120+
#if HAS_LEVELING
121+
void onLevelingStart() { screen.levelingStart(); }
122+
void onLevelingDone() { screen.levelingEnd(); }
123+
#endif
128124

125+
#if HAS_MESH
129126
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) {
130127
screen.meshUpdate(xpos, ypos);
131128
}
132-
133129
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const probe_state_t state) { }
134130
#endif
135131

@@ -147,7 +143,7 @@ namespace ExtUI {
147143
#endif
148144

149145
#if HAS_PID_HEATING
150-
void onPidTuning(const result_t rst) {
146+
void onPIDTuning(const result_t rst) {
151147
// Called for temperature PID tuning result
152148
screen.pidTuning(rst);
153149
}

0 commit comments

Comments
 (0)