Skip to content

Commit e50980e

Browse files
dwzgthinkyhead
authored andcommitted
🩹 Fix DWIN MarlinUI Fan/E/XY (MarlinFirmware#25502)
1 parent c3b037e commit e50980e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,11 @@ void _draw_axis_value(const AxisEnum axis, const char *value, const bool blink,
110110

111111
void _draw_e_value(const_float_t value, const uint16_t x, const uint16_t y) {
112112
const uint8_t scale = value >= 100000.0f ? 10 : 1; // show cm after 99,999mm
113+
const bool e_redraw = !ui.did_first_redraw || old_is_printing != print_job_timer.isRunning();
113114

114115
#if ENABLED(DWIN_MARLINUI_PORTRAIT)
115116

116-
if (!ui.did_first_redraw) {
117+
if (e_redraw) {
117118
// Extra spaces to erase previous value
118119
dwin_string.set(F("E "));
119120
DWIN_Draw_String(true, font16x32, Color_IconBlue, Color_Bg_Black, x + (4 * 14 / 2) - 7, y + 2, S(dwin_string.string()));
@@ -127,7 +128,7 @@ void _draw_axis_value(const AxisEnum axis, const char *value, const bool blink,
127128

128129
#else // !DWIN_MARLINUI_PORTRAIT
129130

130-
if (!ui.did_first_redraw || ui.old_is_printing != print_job_timer.isRunning()) {
131+
if (e_redraw) {
131132
dwin_string.set(F("E "));
132133
DWIN_Draw_String(true, font16x32, Color_IconBlue, Color_Bg_Black, x, y, S(dwin_string.string()));
133134
}
@@ -147,11 +148,10 @@ void _draw_axis_value(const AxisEnum axis, const char *value, const bool blink,
147148
//
148149
FORCE_INLINE void _draw_fan_status(const uint16_t x, const uint16_t y) {
149150
const uint16_t fanx = (4 * STATUS_CHR_WIDTH - STATUS_FAN_WIDTH) / 2;
150-
const uint8_t fan_pct = thermalManager.scaledFanSpeedPercent(0);
151-
const bool fan_on = !!fan_pct;
151+
const bool fan_on = !!thermalManager.scaledFanSpeed(0);
152152
if (fan_on) {
153153
DWIN_ICON_Animation(0, fan_on, ICON, ICON_Fan0, ICON_Fan3, x + fanx, y, 25);
154-
dwin_string.set(i8tostr3rj(fan_pct));
154+
dwin_string.set(i8tostr3rj(thermalManager.scaledFanSpeedPercent(0)));
155155
dwin_string.add('%');
156156
DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, x, y + STATUS_FAN_HEIGHT, S(dwin_string.string()));
157157
}

0 commit comments

Comments
 (0)