Browse Source

Fix nested _draw_chamber_status

Co-Authored-By: alexscarbro <alexscarbro@users.noreply.github.com>
Scott Lahteine 6 years ago
parent
commit
80c6f98d2f
1 changed files with 31 additions and 29 deletions
  1. 31
    29
      Marlin/src/lcd/dogm/status_screen_DOGM.cpp

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

56
   #include "../../feature/mixing.h"
56
   #include "../../feature/mixing.h"
57
 #endif
57
 #endif
58
 
58
 
59
-FORCE_INLINE void _draw_centered_temp(const int16_t temp, const uint8_t tx, const uint8_t ty) {
60
-  const char *str = i16tostr3(temp);
61
-  const uint8_t len = str[0] != ' ' ? 3 : str[1] != ' ' ? 2 : 1;
62
-  lcd_moveto(tx - len * (INFO_FONT_WIDTH) / 2 + 1, ty);
63
-  lcd_put_u8str(&str[3-len]);
64
-  lcd_put_wchar(LCD_STR_DEGREE[0]);
65
-}
66
-
67
 #define X_LABEL_POS      3
59
 #define X_LABEL_POS      3
68
 #define X_VALUE_POS     11
60
 #define X_VALUE_POS     11
69
 #define XYZ_SPACING     37
61
 #define XYZ_SPACING     37
105
   #define SHOW_ON_STATE false
97
   #define SHOW_ON_STATE false
106
 #endif
98
 #endif
107
 
99
 
100
+FORCE_INLINE void _draw_centered_temp(const int16_t temp, const uint8_t tx, const uint8_t ty) {
101
+  const char *str = i16tostr3(temp);
102
+  const uint8_t len = str[0] != ' ' ? 3 : str[1] != ' ' ? 2 : 1;
103
+  lcd_moveto(tx - len * (INFO_FONT_WIDTH) / 2 + 1, ty);
104
+  lcd_put_u8str(&str[3-len]);
105
+  lcd_put_wchar(LCD_STR_DEGREE[0]);
106
+}
107
+
108
 FORCE_INLINE void _draw_heater_status(const heater_ind_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);
133
                 target = IFBED(thermalManager.degTargetBed(), thermalManager.degTargetHotend(heater));
133
                 target = IFBED(thermalManager.degTargetBed(), thermalManager.degTargetHotend(heater));
134
   #endif
134
   #endif
135
 
135
 
136
-  #if HAS_HEATED_CHAMBER
137
-    FORCE_INLINE void _draw_chamber_status(const bool blink) {
138
-      const float temp = thermalManager.degChamber(),
139
-                  target = thermalManager.degTargetChamber();
140
-      #if !HEATER_IDLE_HANDLER
141
-        UNUSED(blink);
142
-      #endif
143
-      if (PAGE_UNDER(7)) {
144
-        #if HEATER_IDLE_HANDLER
145
-          const bool is_idle = false, // thermalManager.chamber_idle.timed_out,
146
-                     dodraw = (blink || !is_idle);
147
-        #else
148
-          constexpr bool dodraw = true;
149
-        #endif
150
-        if (dodraw) _draw_centered_temp(target + 0.5, STATUS_CHAMBER_TEXT_X, 7);
151
-      }
152
-      if (PAGE_CONTAINS(28 - INFO_FONT_ASCENT, 28 - 1))
153
-        _draw_centered_temp(temp + 0.5f, STATUS_CHAMBER_TEXT_X, 28);
154
-    }
155
-  #endif
156
-
157
   #if DISABLED(STATUS_HOTEND_ANIM)
136
   #if DISABLED(STATUS_HOTEND_ANIM)
158
     #define STATIC_HOTEND true
137
     #define STATIC_HOTEND true
159
     #define HOTEND_DOT    isHeat
138
     #define HOTEND_DOT    isHeat
255
 
234
 
256
 }
235
 }
257
 
236
 
237
+#if HAS_HEATED_CHAMBER
238
+
239
+  FORCE_INLINE void _draw_chamber_status(const bool blink) {
240
+    const float temp = thermalManager.degChamber(),
241
+                target = thermalManager.degTargetChamber();
242
+    #if !HEATER_IDLE_HANDLER
243
+      UNUSED(blink);
244
+    #endif
245
+    if (PAGE_UNDER(7)) {
246
+      #if HEATER_IDLE_HANDLER
247
+        const bool is_idle = false, // thermalManager.chamber_idle.timed_out,
248
+                   dodraw = (blink || !is_idle);
249
+      #else
250
+        constexpr bool dodraw = true;
251
+      #endif
252
+      if (dodraw) _draw_centered_temp(target + 0.5, STATUS_CHAMBER_TEXT_X, 7);
253
+    }
254
+    if (PAGE_CONTAINS(28 - INFO_FONT_ASCENT, 28 - 1))
255
+      _draw_centered_temp(temp + 0.5f, STATUS_CHAMBER_TEXT_X, 28);
256
+  }
257
+
258
+#endif
259
+
258
 //
260
 //
259
 // Before homing, blink '123' <-> '???'.
261
 // Before homing, blink '123' <-> '???'.
260
 // Homed but unknown... '123' <-> '   '.
262
 // Homed but unknown... '123' <-> '   '.

Loading…
Cancel
Save