Skip to content

Commit b7c2363

Browse files
ellenspthinkyhead
andauthored
🐛 Fix misc. UI issues (MarlinFirmware#25252)
Co-authored-by: Scott Lahteine <[email protected]>
1 parent f2b8942 commit b7c2363

16 files changed

+52
-43
lines changed

Marlin/src/gcode/host/M115.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ void GcodeSuite::M115() {
232232
const xyz_pos_t lmin = dmin.asLogical(), lmax = dmax.asLogical(),
233233
wmin = cmin.asLogical(), wmax = cmax.asLogical();
234234

235-
SERIAL_ECHOLNPGM(
235+
SERIAL_ECHOPGM(
236236
"area:{"
237237
"full:{"
238238
"min:{"
@@ -249,6 +249,8 @@ void GcodeSuite::M115() {
249249
),
250250
"}" // max
251251
"}," // full
252+
);
253+
SERIAL_ECHOLNPGM(
252254
"work:{"
253255
"min:{"
254256
LIST_N(DOUBLE(NUM_AXES),

Marlin/src/inc/Conditionals_adv.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,10 @@
656656
#define HAS_MEDIA_SUBCALLS 1
657657
#endif
658658

659+
#if ANY(SHOW_PROGRESS_PERCENT, SHOW_ELAPSED_TIME, SHOW_REMAINING_TIME, SHOW_INTERACTION_TIME)
660+
#define HAS_EXTRA_PROGRESS 1
661+
#endif
662+
659663
#if HAS_PRINT_PROGRESS && EITHER(PRINT_PROGRESS_SHOW_DECIMALS, SHOW_REMAINING_TIME)
660664
#define HAS_PRINT_PROGRESS_PERMYRIAD 1
661665
#endif

Marlin/src/inc/SanityCheck.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
944944
#error "SET_PROGRESS_MANUALLY requires at least one of SET_PROGRESS_PERCENT, SET_REMAINING_TIME, SET_INTERACTION_TIME to be enabled."
945945
#endif
946946

947-
#if HAS_LCDPRINT && LCD_HEIGHT < 4 && ANY(SHOW_PROGRESS_PERCENT, SHOW_ELAPSED_TIME, SHOW_REMAINING_TIME, SHOW_INTERACTION_TIME)
947+
#if HAS_LCDPRINT && HAS_EXTRA_PROGRESS && LCD_HEIGHT < 4
948948
#error "Displays with fewer than 4 rows of text can't show progress values."
949949
#endif
950950

Marlin/src/lcd/dogm/status_screen_DOGM.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
444444
}
445445

446446
// Prepare strings for progress display
447-
#if HAS_PRINT_PROGRESS
447+
#if HAS_EXTRA_PROGRESS
448448
static MarlinUI::progress_t progress = 0;
449449
static char bufferc[13];
450450

Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ bool ST7920_Lite_Status_Screen::indicators_changed() {
705705
void ST7920_Lite_Status_Screen::drawRemain() {
706706
const duration_t remaint = TERN0(SET_REMAINING_TIME, ui.get_remaining_time());
707707
if (printJobOngoing() && remaint.value) {
708-
draw_progress_string( PPOS, prepare_time_string(remaint, 'R'));
708+
draw_progress_string(PPOS, prepare_time_string(remaint, 'R'));
709709
}
710710
}
711711
#endif
@@ -714,7 +714,7 @@ bool ST7920_Lite_Status_Screen::indicators_changed() {
714714
void ST7920_Lite_Status_Screen::drawInter() {
715715
const duration_t interactt = ui.interaction_time;
716716
if (printingIsActive() && interactt.value) {
717-
draw_progress_string( PPOS, prepare_time_string(interactt, 'C'));
717+
draw_progress_string(PPOS, prepare_time_string(interactt, 'C'));
718718
}
719719
}
720720
#endif
@@ -723,7 +723,7 @@ bool ST7920_Lite_Status_Screen::indicators_changed() {
723723
void ST7920_Lite_Status_Screen::drawElapsed() {
724724
if (printJobOngoing()) {
725725
const duration_t elapsedt = print_job_timer.duration();
726-
draw_progress_string( PPOS, prepare_time_string(elapsedt, 'E'));
726+
draw_progress_string(PPOS, prepare_time_string(elapsedt, 'E'));
727727
}
728728
}
729729
#endif

Marlin/src/lcd/marlinui.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1743,9 +1743,11 @@ void MarlinUI::init() {
17431743
);
17441744
}
17451745

1746-
#if LCD_WITH_BLINK && DISABLED(HAS_GRAPHICAL_TFT)
1747-
typedef void (*PrintProgress_t)();
1748-
void MarlinUI::rotate_progress() { // Renew and redraw all enabled progress strings
1746+
#if LCD_WITH_BLINK && HAS_EXTRA_PROGRESS
1747+
1748+
// Renew and redraw all enabled progress strings
1749+
void MarlinUI::rotate_progress() {
1750+
typedef void (*PrintProgress_t)();
17491751
const PrintProgress_t progFunc[] = {
17501752
OPTITEM(SHOW_PROGRESS_PERCENT, drawPercent)
17511753
OPTITEM(SHOW_ELAPSED_TIME, drawElapsed)
@@ -1760,7 +1762,8 @@ void MarlinUI::init() {
17601762
(*progFunc[i])();
17611763
}
17621764
}
1763-
#endif
1765+
1766+
#endif // LCD_WITH_BLINK && HAS_EXTRA_PROGRESS
17641767

17651768
#endif // HAS_PRINT_PROGRESS
17661769

Marlin/src/lcd/marlinui.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ class MarlinUI {
334334
FORCE_INLINE static uint16_t get_progress_permyriad() { return _get_progress(); }
335335
#endif
336336
static uint8_t get_progress_percent() { return uint8_t(_get_progress() / (PROGRESS_SCALE)); }
337-
#if LCD_WITH_BLINK
337+
#if LCD_WITH_BLINK && HAS_EXTRA_PROGRESS
338338
#if ENABLED(SHOW_PROGRESS_PERCENT)
339339
static void drawPercent();
340340
#endif
@@ -348,6 +348,8 @@ class MarlinUI {
348348
static void drawInter();
349349
#endif
350350
static void rotate_progress();
351+
#else
352+
static void rotate_progress() {}
351353
#endif
352354
#else
353355
static constexpr uint8_t get_progress_percent() { return 0; }

Marlin/src/lcd/menu/menu_advanced.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ void menu_backlash();
377377

378378
#if ENABLED(MPC_INCLUDE_FAN)
379379
#define MPC_EDIT_ITEMS(N) \
380-
MPC_t &mpc = thermalManager.temp_hotend[MenuItemBase::itemIndex].constants; \
380+
MPC_t &mpc = thermalManager.temp_hotend[MenuItemBase::itemIndex].mpc; \
381381
_MPC_EDIT_ITEMS(N); \
382382
EDIT_ITEM_FAST_N(float43, N, MSG_MPC_AMBIENT_XFER_COEFF_FAN_E, &editable.decimal, 0, 1, []{ \
383383
thermalManager.temp_hotend[MenuItemBase::itemIndex].applyFanAdjustment(editable.decimal); \

Marlin/src/lcd/tft/ui_1024x600.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -675,12 +675,10 @@ static void drawAxisValue(const AxisEnum axis) {
675675
static void moveAxis(const AxisEnum axis, const int8_t direction) {
676676
quick_feedback();
677677

678-
#if ENABLED(PREVENT_COLD_EXTRUSION)
679-
if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) {
680-
drawMessage(F("Too cold"));
681-
return;
682-
}
683-
#endif
678+
if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) {
679+
drawMessage(F("Too cold"));
680+
return;
681+
}
684682

685683
const float diff = motionAxisState.currentStepSize * direction;
686684

Marlin/src/lcd/tft/ui_320x240.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -768,12 +768,10 @@ static void drawAxisValue(const AxisEnum axis) {
768768
static void moveAxis(const AxisEnum axis, const int8_t direction) {
769769
quick_feedback();
770770

771-
#if ENABLED(PREVENT_COLD_EXTRUSION)
772-
if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) {
773-
drawMessage(F("Too cold"));
774-
return;
775-
}
776-
#endif
771+
if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) {
772+
drawMessage(F("Too cold"));
773+
return;
774+
}
777775

778776
const float diff = motionAxisState.currentStepSize * direction;
779777

0 commit comments

Comments
 (0)