Skip to content

Commit 25e7e2f

Browse files
ellenspthinkyhead
authored andcommitted
🐛 Fix heater display options/compile (MarlinFirmware#22185)
1 parent a0f7f0e commit 25e7e2f

File tree

4 files changed

+45
-36
lines changed

4 files changed

+45
-36
lines changed

Marlin/Configuration_adv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1594,7 +1594,7 @@
15941594
*/
15951595
//#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones
15961596
//#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends)
1597-
#define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM)
1597+
#define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM for numbered hotends)
15981598
#define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating
15991599
#define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating
16001600
#define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating

Marlin/src/inc/SanityCheck.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,6 +1039,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
10391039
#error "EXTRUDERS must be 1 with HEATERS_PARALLEL."
10401040
#endif
10411041

1042+
#if ENABLED(STATUS_HOTEND_INVERTED) && NONE(STATUS_HOTEND_NUMBERLESS, STATUS_HOTEND_ANIM)
1043+
#error "With multiple hotends STATUS_HOTEND_INVERTED requires STATUS_HOTEND_ANIM or STATUS_HOTEND_NUMBERLESS."
1044+
#endif
1045+
10421046
#if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
10431047
#ifndef TOOLCHANGE_FS_LENGTH
10441048
#error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_LENGTH."

Marlin/src/lcd/dogm/status/hotend.h

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,33 @@
3939

4040
#define STATUS_HOTEND1_WIDTH 16
4141

42-
#if STATUS_HOTEND_BITMAPS == 1 || ENABLED(STATUS_HOTEND_NUMBERLESS)
42+
#if STATUS_HOTEND_BITMAPS == 1 || defined(STATUS_HOTEND_NUMBERLESS)
4343

4444
const unsigned char status_hotend_a_bmp[] PROGMEM = {
4545
B00011111,B11100000,
46-
B00111111,B11110000,
47-
B00111111,B11110000,
48-
B00111111,B11110000,
49-
B00011111,B11100000,
50-
B00011111,B11100000,
51-
B00111111,B11110000,
52-
B00111111,B11110000,
53-
B00111111,B11110000,
54-
B00001111,B11000000,
55-
B00000111,B10000000,
46+
#if defined(STATUS_HOTEND_INVERTED) && !defined(STATUS_HOTEND_ANIM)
47+
B00100000,B00010000,
48+
B00100000,B00010000,
49+
B00100000,B00010000,
50+
B00010000,B00100000,
51+
B00010000,B00100000,
52+
B00100000,B00010000,
53+
B00100000,B00010000,
54+
B00110000,B00110000,
55+
B00001000,B01000000,
56+
B00000100,B10000000,
57+
#else
58+
B00111111,B11110000,
59+
B00111111,B11110000,
60+
B00111111,B11110000,
61+
B00011111,B11100000,
62+
B00011111,B11100000,
63+
B00111111,B11110000,
64+
B00111111,B11110000,
65+
B00111111,B11110000,
66+
B00001111,B11000000,
67+
B00000111,B10000000,
68+
#endif
5669
B00000011,B00000000
5770
};
5871

Marlin/src/lcd/dogm/status_screen_DOGM.cpp

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -236,18 +236,12 @@ FORCE_INLINE void _draw_centered_temp(const celsius_t temp, const uint8_t tx, co
236236
#define HOTEND_DOT false
237237
#endif
238238

239-
#if ANIM_HOTEND && BOTH(STATUS_HOTEND_INVERTED, STATUS_HOTEND_NUMBERLESS)
240-
#define OFF_BMP(N) status_hotend_b_bmp
241-
#define ON_BMP(N) status_hotend_a_bmp
242-
#elif ANIM_HOTEND && DISABLED(STATUS_HOTEND_INVERTED) && ENABLED(STATUS_HOTEND_NUMBERLESS)
243-
#define OFF_BMP(N) status_hotend_a_bmp
244-
#define ON_BMP(N) status_hotend_b_bmp
245-
#elif BOTH(ANIM_HOTEND, STATUS_HOTEND_INVERTED)
246-
#define OFF_BMP(N) status_hotend##N##_b_bmp
247-
#define ON_BMP(N) status_hotend##N##_a_bmp
239+
#if ENABLED(STATUS_HOTEND_NUMBERLESS)
240+
#define OFF_BMP(N) TERN(STATUS_HOTEND_INVERTED, status_hotend_b_bmp, status_hotend_a_bmp)
241+
#define ON_BMP(N) TERN(STATUS_HOTEND_INVERTED, status_hotend_a_bmp, status_hotend_b_bmp)
248242
#else
249-
#define OFF_BMP(N) status_hotend##N##_a_bmp
250-
#define ON_BMP(N) status_hotend##N##_b_bmp
243+
#define OFF_BMP(N) TERN(STATUS_HOTEND_INVERTED, status_hotend##N##_b_bmp, status_hotend##N##_a_bmp)
244+
#define ON_BMP(N) TERN(STATUS_HOTEND_INVERTED, status_hotend##N##_a_bmp, status_hotend##N##_b_bmp)
251245
#endif
252246

253247
#if STATUS_HOTEND_BITMAPS > 1
@@ -275,20 +269,18 @@ FORCE_INLINE void _draw_centered_temp(const celsius_t temp, const uint8_t tx, co
275269
uint8_t tall = uint8_t(perc * BAR_TALL + 0.5f);
276270
NOMORE(tall, BAR_TALL);
277271

278-
#if ANIM_HOTEND
279-
// Draw hotend bitmap, either whole or split by the heating percent
280-
const uint8_t hx = STATUS_HOTEND_X(heater_id),
281-
bw = STATUS_HOTEND_BYTEWIDTH(heater_id);
282-
#if ENABLED(STATUS_HEAT_PERCENT)
283-
if (isHeat && tall <= BAR_TALL) {
284-
const uint8_t ph = STATUS_HEATERS_HEIGHT - 1 - tall;
285-
u8g.drawBitmapP(hx, STATUS_HEATERS_Y, bw, ph, HOTEND_BITMAP(TERN(HAS_MMU, active_extruder, heater_id), false));
286-
u8g.drawBitmapP(hx, STATUS_HEATERS_Y + ph, bw, tall + 1, HOTEND_BITMAP(TERN(HAS_MMU, active_extruder, heater_id), true) + ph * bw);
287-
}
288-
else
289-
#endif
290-
u8g.drawBitmapP(hx, STATUS_HEATERS_Y, bw, STATUS_HEATERS_HEIGHT, HOTEND_BITMAP(TERN(HAS_MMU, active_extruder, heater_id), isHeat));
272+
// Draw hotend bitmap, either whole or split by the heating percent
273+
const uint8_t hx = STATUS_HOTEND_X(heater_id),
274+
bw = STATUS_HOTEND_BYTEWIDTH(heater_id);
275+
#if ENABLED(STATUS_HEAT_PERCENT)
276+
if (isHeat && tall <= BAR_TALL) {
277+
const uint8_t ph = STATUS_HEATERS_HEIGHT - 1 - tall;
278+
u8g.drawBitmapP(hx, STATUS_HEATERS_Y, bw, ph, HOTEND_BITMAP(TERN(HAS_MMU, active_extruder, heater_id), false));
279+
u8g.drawBitmapP(hx, STATUS_HEATERS_Y + ph, bw, tall + 1, HOTEND_BITMAP(TERN(HAS_MMU, active_extruder, heater_id), true) + ph * bw);
280+
}
281+
else
291282
#endif
283+
u8g.drawBitmapP(hx, STATUS_HEATERS_Y, bw, STATUS_HEATERS_HEIGHT, HOTEND_BITMAP(TERN(HAS_MMU, active_extruder, heater_id), isHeat));
292284

293285
} // PAGE_CONTAINS
294286

0 commit comments

Comments
 (0)