Browse Source

Use heater index defines

Scott Lahteine 6 years ago
parent
commit
ae9232962e

+ 12
- 14
Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp View File

526
   }
526
   }
527
 }
527
 }
528
 
528
 
529
-FORCE_INLINE void _draw_heater_status(const int8_t heater, const char prefix, const bool blink) {
529
+FORCE_INLINE void _draw_heater_status(const heater_ind_t heater, const char prefix, const bool blink) {
530
   #if HAS_HEATED_BED
530
   #if HAS_HEATED_BED
531
     const bool isBed = heater < 0;
531
     const bool isBed = heater < 0;
532
     const float t1 = (isBed ? thermalManager.degBed()       : thermalManager.degHotend(heater)),
532
     const float t1 = (isBed ? thermalManager.degBed()       : thermalManager.degHotend(heater)),
567
 }
567
 }
568
 
568
 
569
 FORCE_INLINE void _draw_bed_status(const bool blink) {
569
 FORCE_INLINE void _draw_bed_status(const bool blink) {
570
-  _draw_heater_status(-1, (
570
+  _draw_heater_status(H_BED, (
571
     #if HAS_LEVELING
571
     #if HAS_LEVELING
572
       planner.leveling_active && blink ? '_' :
572
       planner.leveling_active && blink ? '_' :
573
     #endif
573
     #endif
750
       //
750
       //
751
       // Hotend 0 Temperature
751
       // Hotend 0 Temperature
752
       //
752
       //
753
-      _draw_heater_status(0, -1, blink);
753
+      _draw_heater_status(H_E0, -1, blink);
754
 
754
 
755
       //
755
       //
756
       // Hotend 1 or Bed Temperature
756
       // Hotend 1 or Bed Temperature
757
       //
757
       //
758
       #if HOTENDS > 1
758
       #if HOTENDS > 1
759
         lcd_moveto(8, 0);
759
         lcd_moveto(8, 0);
760
-        lcd_put_wchar(LCD_STR_THERMOMETER[0]);
761
-        _draw_heater_status(1, -1, blink);
760
+        _draw_heater_status(H_E1, LCD_STR_THERMOMETER[0], blink);
762
       #elif HAS_HEATED_BED
761
       #elif HAS_HEATED_BED
763
         lcd_moveto(8, 0);
762
         lcd_moveto(8, 0);
764
-        lcd_put_wchar(LCD_STR_BEDTEMP[0]);
765
-        _draw_heater_status(-1, -1, blink);
763
+        _draw_bed_status(blink);
766
       #endif
764
       #endif
767
 
765
 
768
     #else // LCD_WIDTH >= 20
766
     #else // LCD_WIDTH >= 20
770
       //
768
       //
771
       // Hotend 0 Temperature
769
       // Hotend 0 Temperature
772
       //
770
       //
773
-      _draw_heater_status(0, LCD_STR_THERMOMETER[0], blink);
771
+      _draw_heater_status(H_E0, LCD_STR_THERMOMETER[0], blink);
774
 
772
 
775
       //
773
       //
776
       // Hotend 1 or Bed Temperature
774
       // Hotend 1 or Bed Temperature
777
       //
775
       //
778
       #if HOTENDS > 1
776
       #if HOTENDS > 1
779
         lcd_moveto(10, 0);
777
         lcd_moveto(10, 0);
780
-        _draw_heater_status(1, LCD_STR_THERMOMETER[0], blink);
778
+        _draw_heater_status(H_E1, LCD_STR_THERMOMETER[0], blink);
781
       #elif HAS_HEATED_BED
779
       #elif HAS_HEATED_BED
782
         lcd_moveto(10, 0);
780
         lcd_moveto(10, 0);
783
         _draw_bed_status(blink);
781
         _draw_bed_status(blink);
806
         #if HOTENDS > 2 || (HOTENDS > 1 && HAS_HEATED_BED)
804
         #if HOTENDS > 2 || (HOTENDS > 1 && HAS_HEATED_BED)
807
 
805
 
808
           #if HOTENDS > 2
806
           #if HOTENDS > 2
809
-            _draw_heater_status(2, LCD_STR_THERMOMETER[0], blink);
807
+            _draw_heater_status(H_E2, LCD_STR_THERMOMETER[0], blink);
810
             lcd_moveto(10, 1);
808
             lcd_moveto(10, 1);
811
           #endif
809
           #endif
812
 
810
 
911
     //
909
     //
912
     // Hotend 0 Temperature
910
     // Hotend 0 Temperature
913
     //
911
     //
914
-    _draw_heater_status(0, LCD_STR_THERMOMETER[0], blink);
912
+    _draw_heater_status(H_E0, LCD_STR_THERMOMETER[0], blink);
915
 
913
 
916
     //
914
     //
917
     // Z Coordinate
915
     // Z Coordinate
931
     //
929
     //
932
     lcd_moveto(0, 1);
930
     lcd_moveto(0, 1);
933
     #if HOTENDS > 1
931
     #if HOTENDS > 1
934
-      _draw_heater_status(1, LCD_STR_THERMOMETER[0], blink);
932
+      _draw_heater_status(H_E1, LCD_STR_THERMOMETER[0], blink);
935
     #elif HAS_HEATED_BED
933
     #elif HAS_HEATED_BED
936
       _draw_bed_status(blink);
934
       _draw_bed_status(blink);
937
     #endif
935
     #endif
948
     //
946
     //
949
     lcd_moveto(0, 2);
947
     lcd_moveto(0, 2);
950
     #if HOTENDS > 2
948
     #if HOTENDS > 2
951
-      _draw_heater_status(2, LCD_STR_THERMOMETER[0], blink);
949
+      _draw_heater_status(H_E2, LCD_STR_THERMOMETER[0], blink);
952
     #elif HOTENDS > 1 && HAS_HEATED_BED
950
     #elif HOTENDS > 1 && HAS_HEATED_BED
953
       _draw_bed_status(blink);
951
       _draw_bed_status(blink);
954
     #elif HAS_PRINT_PROGRESS
952
     #elif HAS_PRINT_PROGRESS
987
     void MarlinUI::draw_hotend_status(const uint8_t row, const uint8_t extruder) {
985
     void MarlinUI::draw_hotend_status(const uint8_t row, const uint8_t extruder) {
988
       if (row < LCD_HEIGHT) {
986
       if (row < LCD_HEIGHT) {
989
         lcd_moveto(LCD_WIDTH - 9, row);
987
         lcd_moveto(LCD_WIDTH - 9, row);
990
-        _draw_heater_status(extruder, LCD_STR_THERMOMETER[0], get_blink());
988
+        _draw_heater_status((heater_ind_t)extruder, LCD_STR_THERMOMETER[0], get_blink());
991
       }
989
       }
992
     }
990
     }
993
 
991
 

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

105
   #define SHOW_ON_STATE false
105
   #define SHOW_ON_STATE false
106
 #endif
106
 #endif
107
 
107
 
108
-FORCE_INLINE void _draw_heater_status(const int8_t heater, const bool blink) {
108
+FORCE_INLINE void _draw_heater_status(const heater_ind_t heater, const bool blink) {
109
   #if !HEATER_IDLE_HANDLER
109
   #if !HEATER_IDLE_HANDLER
110
     UNUSED(blink);
110
     UNUSED(blink);
111
   #endif
111
   #endif
404
   if (PAGE_UNDER(6 + 1 + 12 + 1 + 6 + 1)) {
404
   if (PAGE_UNDER(6 + 1 + 12 + 1 + 6 + 1)) {
405
     // Extruders
405
     // Extruders
406
     for (uint8_t e = 0; e < MAX_HOTEND_DRAW; ++e)
406
     for (uint8_t e = 0; e < MAX_HOTEND_DRAW; ++e)
407
-      _draw_heater_status(e, blink);
407
+      _draw_heater_status((heater_ind_t)e, blink);
408
 
408
 
409
     // Heated bed
409
     // Heated bed
410
     #if HAS_HEATED_BED && HOTENDS < 4
410
     #if HAS_HEATED_BED && HOTENDS < 4
411
-      _draw_heater_status(-1, blink);
411
+      _draw_heater_status(H_BED, blink);
412
     #endif
412
     #endif
413
 
413
 
414
     #if HAS_HEATED_CHAMBER
414
     #if HAS_HEATED_CHAMBER

Loading…
Cancel
Save