Skip to content

Commit 283e39f

Browse files
committed
🎨 Misc. LCD cleanup (MarlinFirmware#25400)
1 parent dfec3a2 commit 283e39f

Some content is hidden

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

76 files changed

+541
-951
lines changed

Marlin/Configuration_adv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2092,7 +2092,7 @@
20922092
//#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping
20932093
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
20942094
//#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets
2095-
//#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor
2095+
//#define BABYSTEP_GFX_OVERLAY // Enable graphical overlay on Z-offset editor
20962096
#endif
20972097
#endif
20982098

Marlin/src/feature/bedlevel/abl/bbl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ void LevelingBilinear::extrapolate_unprobed_bed_level() {
153153
}
154154
}
155155

156-
void LevelingBilinear::print_leveling_grid(const bed_mesh_t* _z_values /*= NULL*/) {
156+
void LevelingBilinear::print_leveling_grid(const bed_mesh_t* _z_values/*=nullptr*/) {
157157
// print internal grid(s) or just the one passed as a parameter
158158
SERIAL_ECHOLNPGM("Bilinear Leveling Grid:");
159159
print_2d_array(GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y, 3, _z_values ? *_z_values[0] : z_values[0]);

Marlin/src/feature/bedlevel/abl/bbl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class LevelingBilinear {
5353
static void reset();
5454
static void set_grid(const xy_pos_t& _grid_spacing, const xy_pos_t& _grid_start);
5555
static void extrapolate_unprobed_bed_level();
56-
static void print_leveling_grid(const bed_mesh_t* _z_values = NULL);
56+
static void print_leveling_grid(const bed_mesh_t *_z_values=nullptr);
5757
static void refresh_bed_level();
5858
static bool has_mesh() { return !!grid_spacing.x; }
5959
static bool mesh_is_valid() { return has_mesh(); }

Marlin/src/inc/SanityCheck.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,8 @@
670670
#error "MILLISECONDS_PREHEAT_TIME is now PREHEAT_TIME_HOTEND_MS."
671671
#elif defined(EXPERIMENTAL_SCURVE)
672672
#error "EXPERIMENTAL_SCURVE is no longer needed and should be removed."
673+
#elif defined(BABYSTEP_ZPROBE_GFX_OVERLAY)
674+
#error "BABYSTEP_ZPROBE_GFX_OVERLAY is now BABYSTEP_GFX_OVERLAY."
673675
#endif
674676

675677
// L64xx stepper drivers have been removed
@@ -1042,10 +1044,10 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
10421044
#error "MESH_BED_LEVELING and BABYSTEP_ZPROBE_OFFSET is not a valid combination"
10431045
#elif ENABLED(BABYSTEP_ZPROBE_OFFSET) && !HAS_BED_PROBE
10441046
#error "BABYSTEP_ZPROBE_OFFSET requires a probe."
1045-
#elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && NONE(HAS_MARLINUI_U8GLIB, IS_DWIN_MARLINUI)
1046-
#error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a Graphical LCD."
1047-
#elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && DISABLED(BABYSTEP_ZPROBE_OFFSET)
1048-
#error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a BABYSTEP_ZPROBE_OFFSET."
1047+
#elif ENABLED(BABYSTEP_GFX_OVERLAY) && NONE(HAS_MARLINUI_U8GLIB, IS_DWIN_MARLINUI)
1048+
#error "BABYSTEP_GFX_OVERLAY requires a Graphical LCD."
1049+
#elif ENABLED(BABYSTEP_GFX_OVERLAY) && DISABLED(BABYSTEP_ZPROBE_OFFSET)
1050+
#error "BABYSTEP_GFX_OVERLAY requires a BABYSTEP_ZPROBE_OFFSET."
10491051
#elif ENABLED(BABYSTEP_HOTEND_Z_OFFSET) && !HAS_HOTEND_OFFSET
10501052
#error "BABYSTEP_HOTEND_Z_OFFSET requires 2 or more HOTENDS."
10511053
#elif BOTH(BABYSTEP_ALWAYS_AVAILABLE, MOVE_Z_WHEN_IDLE)

Marlin/src/lcd/dogm/marlinui_DOGM.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
628628

629629
#endif // AUTO_BED_LEVELING_UBL
630630

631-
#if EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY)
631+
#if EITHER(BABYSTEP_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY)
632632

633633
//
634634
// Draw knob rotation => Z motion key for:
@@ -746,7 +746,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
746746
}
747747
}
748748

749-
#endif // BABYSTEP_ZPROBE_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY
749+
#endif // BABYSTEP_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY
750750

751751
#endif // HAS_MARLINUI_MENU
752752

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ void MarlinUI::draw_status_message(const bool blink) {
565565

566566
#endif // AUTO_BED_LEVELING_UBL
567567

568-
#if EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY)
568+
#if EITHER(BABYSTEP_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY)
569569

570570
void MarlinUI::zoffset_overlay(const int8_t dir) {
571571
const int rot_up = TERN(OVERLAY_GFX_REVERSE, ICON_RotateCCW, ICON_RotateCW),
@@ -587,7 +587,7 @@ void MarlinUI::draw_status_message(const bool blink) {
587587
DWIN_ICON_Show(ICON, rot_up, LCD_PIXEL_WIDTH - 10 - 48, arrow_y);
588588
}
589589

590-
#endif // BABYSTEP_ZPROBE_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY
590+
#endif // BABYSTEP_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY
591591

592592
#endif // HAS_MARLINUI_MENU
593593

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

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,6 @@ void EachMomentUpdate() {
12711271

12721272
if ((Printing() != HMI_flag.printing_flag) && !HMI_flag.home_flag) {
12731273
HMI_flag.printing_flag = Printing();
1274-
DEBUG_ECHOLNPGM("printing_flag: ", HMI_flag.printing_flag);
12751274
if (HMI_flag.printing_flag)
12761275
DWIN_Print_Started();
12771276
else if (HMI_flag.abort_flag)
@@ -1282,7 +1281,6 @@ void EachMomentUpdate() {
12821281

12831282
if ((printingIsPaused() != HMI_flag.pause_flag) && !HMI_flag.home_flag) {
12841283
HMI_flag.pause_flag = printingIsPaused();
1285-
DEBUG_ECHOLNPGM("pause_flag: ", HMI_flag.pause_flag);
12861284
if (HMI_flag.pause_flag)
12871285
DWIN_Print_Pause();
12881286
else if (HMI_flag.abort_flag)
@@ -1628,7 +1626,6 @@ void DWIN_LevelingDone() {
16281626

16291627
// Started a Print Job
16301628
void DWIN_Print_Started() {
1631-
DEBUG_ECHOLNPGM("DWIN_Print_Started: ", SD_Printing());
16321629
TERN_(HAS_GCODE_PREVIEW, if (Host_Printing()) Preview_Invalidate());
16331630
_percent_done = 0;
16341631
_remain_time = 0;
@@ -1642,20 +1639,17 @@ void DWIN_Print_Started() {
16421639

16431640
// Pause a print job
16441641
void DWIN_Print_Pause() {
1645-
DEBUG_ECHOLNPGM("DWIN_Print_Pause");
16461642
ICON_ResumeOrPause();
16471643
}
16481644

16491645
// Resume print job
16501646
void DWIN_Print_Resume() {
1651-
DEBUG_ECHOLNPGM("DWIN_Print_Resume");
16521647
ICON_ResumeOrPause();
16531648
LCD_MESSAGE(MSG_RESUME_PRINT);
16541649
}
16551650

16561651
// Ended print job
16571652
void DWIN_Print_Finished() {
1658-
DEBUG_ECHOLNPGM("DWIN_Print_Finished");
16591653
TERN_(POWER_LOSS_RECOVERY, if (card.isPrinting()) recovery.cancel());
16601654
HMI_flag.pause_flag = false;
16611655
wait_for_heatup = false;
@@ -1666,7 +1660,6 @@ void DWIN_Print_Finished() {
16661660

16671661
// Print was aborted
16681662
void DWIN_Print_Aborted() {
1669-
DEBUG_ECHOLNPGM("DWIN_Print_Aborted");
16701663
DWIN_Print_Finished();
16711664
}
16721665

@@ -1714,7 +1707,6 @@ void DWIN_SetColorDefaults() {
17141707
}
17151708

17161709
void DWIN_SetDataDefaults() {
1717-
DEBUG_ECHOLNPGM("DWIN_SetDataDefaults");
17181710
DWIN_SetColorDefaults();
17191711
DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color, HMI_data.StatusBg_Color);
17201712
TERN_(PIDTEMP, HMI_data.HotendPidT = DEF_HOTENDPIDT);
@@ -1738,13 +1730,10 @@ void DWIN_SetDataDefaults() {
17381730
}
17391731

17401732
void DWIN_CopySettingsTo(char * const buff) {
1741-
DEBUG_ECHOLNPGM("DWIN_CopySettingsTo");
1742-
DEBUG_ECHOLNPGM("HMI_data: ", sizeof(HMI_data_t));
17431733
memcpy(buff, &HMI_data, eeprom_data_size);
17441734
}
17451735

17461736
void DWIN_CopySettingsFrom(const char * const buff) {
1747-
DEBUG_ECHOLNPGM("DWIN_CopySettingsFrom");
17481737
memcpy(&HMI_data, buff, sizeof(HMI_data_t));
17491738
if (HMI_data.Text_Color == HMI_data.Background_Color) DWIN_SetColorDefaults();
17501739
DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color, HMI_data.StatusBg_Color);
@@ -1764,18 +1753,14 @@ void DWIN_CopySettingsFrom(const char * const buff) {
17641753

17651754
// Initialize or re-initialize the LCD
17661755
void MarlinUI::init_lcd() {
1767-
DEBUG_ECHOLNPGM("MarlinUI::init_lcd");
17681756
delay(750); // wait to wakeup screen
17691757
const bool hs = DWIN_Handshake(); UNUSED(hs);
1770-
DEBUG_ECHOPGM("DWIN_Handshake ");
1771-
DEBUG_ECHOLNF(hs ? F("ok.") : F("error."));
17721758
DWIN_Frame_SetDir(1);
17731759
DWIN_JPG_CacheTo1(Language_English);
17741760
Encoder_Configuration();
17751761
}
17761762

17771763
void DWIN_InitScreen() {
1778-
DEBUG_ECHOLNPGM("DWIN_InitScreen");
17791764
DWIN_SetColorDefaults();
17801765
HMI_Init(); // draws boot screen
17811766
DWINUI::init();
@@ -2034,7 +2019,6 @@ void AutoHome() { queue.inject_P(G28_STR); }
20342019
#if EITHER(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP)
20352020
const_float_t step_zoffset = round((MenuData.Value / 100.0f) * planner.settings.axis_steps_per_mm[Z_AXIS]) - babystep.accum;
20362021
if (BABYSTEP_ALLOWED()) babystep.add_steps(Z_AXIS, step_zoffset);
2037-
//DEBUG_ECHOLNF(F("BB Steps: "), step_zoffset);
20382022
#endif
20392023
}
20402024
void SetZOffset() {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ bool Has_Preview() {
135135
Get_Value(buf, ";MAXZ:", fileprop.height);
136136
fileprop.height -= tmp;
137137
posptr = strstr(buf, tbstart);
138-
if (posptr != NULL) {
138+
if (posptr != nullptr) {
139139
fileprop.thumbstart = indx + (posptr - &buf[0]);
140140
}
141141
else {

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

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ char FileNavigator::currentfoldername[MAX_PATH_LEN + 1]; // Current folde
7070
FileNavigator::FileNavigator() { reset(); }
7171

7272
void FileNavigator::reset() {
73-
DEBUG_ECHOLNPGM("reset()");
7473
currentfoldername[0] = '\0';
7574
currentfolderdepth = 0;
7675
currentindex = 0;
@@ -86,7 +85,6 @@ void FileNavigator::refresh() { filelist.refresh(); }
8685

8786
void FileNavigator::changeDIR(const char *folder) {
8887
if (currentfolderdepth >= MAX_FOLDER_DEPTH) return; // limit the folder depth
89-
DEBUG_ECHOLNPGM("FD:" , folderdepth, " FP:",currentindex, " currentfolder:", currentfoldername, " enter:", folder);
9088
currentfolderindex[currentfolderdepth] = currentindex;
9189
strcat(currentfoldername, folder);
9290
strcat(currentfoldername, "/");
@@ -96,7 +94,6 @@ void FileNavigator::changeDIR(const char *folder) {
9694
}
9795

9896
void FileNavigator::upDIR() {
99-
DEBUG_ECHOLNPGM("upDIR() from D:", currentfolderdepth, " N:", currentfoldername);
10097
if (!filelist.isAtRootDir()) {
10198
filelist.upDir();
10299
currentfolderdepth--;
@@ -117,7 +114,6 @@ void FileNavigator::skiptofileindex(uint16_t skip) {
117114
if (skip == 0) return;
118115
while (skip > 0) {
119116
if (filelist.seek(currentindex)) {
120-
DEBUG_ECHOLNPGM("CI:", currentindex, " FD:", currentfolderdepth, " N:", skip, " ", filelist.longFilename());
121117
if (!filelist.isDir()) {
122118
skip--;
123119
currentindex++;
@@ -151,8 +147,6 @@ void FileNavigator::skiptofileindex(uint16_t skip) {
151147
}
152148
lastpanelindex = index;
153149

154-
DEBUG_ECHOLNPGM("index=", index, " currentindex=", currentindex);
155-
156150
if (currentindex == 0 && currentfolderdepth > 0) { // Add a link to go up a folder
157151
// The new panel ignores entries that don't end in .GCO or .gcode so add and pad them.
158152
if (paneltype <= AC_panel_new) {
@@ -166,12 +160,8 @@ void FileNavigator::skiptofileindex(uint16_t skip) {
166160
filesneeded--;
167161
}
168162

169-
for (uint16_t seek = currentindex; seek < currentindex + filesneeded; seek++) {
170-
if (filelist.seek(seek)) {
171-
sendFile(paneltype);
172-
DEBUG_ECHOLNPGM("-", seek, " '", filelist.longFilename(), "' '", currentfoldername, "", filelist.shortFilename(), "'");
173-
}
174-
}
163+
for (uint16_t seek = currentindex; seek < currentindex + filesneeded; seek++)
164+
if (filelist.seek(seek)) sendFile(paneltype);
175165
}
176166

177167
void FileNavigator::sendFile(panel_type_t paneltype) {
@@ -212,7 +202,6 @@ void FileNavigator::skiptofileindex(uint16_t skip) {
212202
#else // Flat file list
213203

214204
void FileNavigator::getFiles(uint16_t index, panel_type_t paneltype, uint8_t filesneeded) {
215-
DEBUG_ECHOLNPGM("getFiles() I:", index," L:", lastpanelindex);
216205
// if we're searching backwards, jump back to start and search forward
217206
if (index < lastpanelindex) {
218207
reset();
@@ -248,7 +237,6 @@ void FileNavigator::skiptofileindex(uint16_t skip) {
248237
TFTSer.println(filelist.shortFilename());
249238
if (currentfolderdepth > 0) TFTSer.print(currentfoldername);
250239
TFTSer.println(filelist.longFilename());
251-
DEBUG_ECHOLNPGM("/", currentfoldername, "", filelist.shortFilename(), " ", filelist.longFilename());
252240
}
253241

254242
#endif // Flat file list

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ void AnycubicTFTClass::GetCommandFromTFT() {
704704
break;
705705

706706
case 16: { // A16 set hotend temp
707-
unsigned int tempvalue;
707+
uint16_t tempvalue;
708708
if (CodeSeen('S')) {
709709
tempvalue = constrain(CodeValue(), 0, 275);
710710
setTargetTemp_celsius(tempvalue, (extruder_t)E0);
@@ -719,7 +719,7 @@ void AnycubicTFTClass::GetCommandFromTFT() {
719719
break;
720720

721721
case 17: { // A17 set heated bed temp
722-
unsigned int tempbed;
722+
uint16_t tempbed;
723723
if (CodeSeen('S')) {
724724
tempbed = constrain(CodeValue(), 0, 100);
725725
setTargetTemp_celsius(tempbed, (heater_t)BED);
@@ -777,7 +777,7 @@ void AnycubicTFTClass::GetCommandFromTFT() {
777777
case 22: // A22 move X/Y/Z or extrude
778778
if (!isPrinting()) {
779779
float coorvalue;
780-
unsigned int movespeed = 0;
780+
uint16_t movespeed = 0;
781781
char commandStr[30];
782782
char fullCommandStr[38];
783783

0 commit comments

Comments
 (0)