Browse Source

🐛 Fix heater display options/compile (#22185)

ellensp 3 years ago
parent
commit
6bf6973e9d
No account linked to committer's email address

+ 1
- 1
Marlin/Configuration_adv.h View File

@@ -1594,7 +1594,7 @@
1594 1594
    */
1595 1595
   //#define STATUS_COMBINE_HEATERS    // Use combined heater images instead of separate ones
1596 1596
   //#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)
1598 1598
   #define STATUS_HOTEND_ANIM          // Use a second bitmap to indicate hotend heating
1599 1599
   #define STATUS_BED_ANIM             // Use a second bitmap to indicate bed heating
1600 1600
   #define STATUS_CHAMBER_ANIM         // Use a second bitmap to indicate chamber heating

+ 4
- 0
Marlin/src/inc/SanityCheck.h View File

@@ -1039,6 +1039,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
1039 1039
     #error "EXTRUDERS must be 1 with HEATERS_PARALLEL."
1040 1040
   #endif
1041 1041
 
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
+
1042 1046
   #if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
1043 1047
     #ifndef TOOLCHANGE_FS_LENGTH
1044 1048
       #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_LENGTH."

+ 24
- 11
Marlin/src/lcd/dogm/status/hotend.h View File

@@ -39,20 +39,33 @@
39 39
 
40 40
 #define STATUS_HOTEND1_WIDTH  16
41 41
 
42
-#if STATUS_HOTEND_BITMAPS == 1 || ENABLED(STATUS_HOTEND_NUMBERLESS)
42
+#if STATUS_HOTEND_BITMAPS == 1 || defined(STATUS_HOTEND_NUMBERLESS)
43 43
 
44 44
   const unsigned char status_hotend_a_bmp[] PROGMEM = {
45 45
     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
56 69
     B00000011,B00000000
57 70
   };
58 71
 

+ 16
- 24
Marlin/src/lcd/dogm/status_screen_DOGM.cpp View File

@@ -236,18 +236,12 @@ FORCE_INLINE void _draw_centered_temp(const celsius_t temp, const uint8_t tx, co
236 236
       #define HOTEND_DOT    false
237 237
     #endif
238 238
 
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)
248 242
     #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)
251 245
     #endif
252 246
 
253 247
     #if STATUS_HOTEND_BITMAPS > 1
@@ -275,20 +269,18 @@ FORCE_INLINE void _draw_centered_temp(const celsius_t temp, const uint8_t tx, co
275 269
       uint8_t tall = uint8_t(perc * BAR_TALL + 0.5f);
276 270
       NOMORE(tall, BAR_TALL);
277 271
 
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
291 282
       #endif
283
+          u8g.drawBitmapP(hx, STATUS_HEATERS_Y, bw, STATUS_HEATERS_HEIGHT, HOTEND_BITMAP(TERN(HAS_MMU, active_extruder, heater_id), isHeat));
292 284
 
293 285
     } // PAGE_CONTAINS
294 286
 

Loading…
Cancel
Save