Pārlūkot izejas kodu

Heater error status

Scott Lahteine 3 gadus atpakaļ
vecāks
revīzija
e4f60f82a4

+ 1
- 1
Marlin/src/lcd/HD44780/marlinui_HD44780.cpp Parādīt failu

@@ -535,7 +535,7 @@ FORCE_INLINE void _draw_heater_status(const heater_id_t heater_id, const char pr
535 535
 
536 536
   if (prefix >= 0) lcd_put_wchar(prefix);
537 537
 
538
-  lcd_put_u8str(i16tostr3rj(t1));
538
+  lcd_put_u8str(t1 < 0 ? "err" : i16tostr3rj(t1));
539 539
   lcd_put_wchar('/');
540 540
 
541 541
   #if !HEATER_IDLE_HANDLER

+ 8
- 4
Marlin/src/lcd/dogm/status_screen_DOGM.cpp Parādīt failu

@@ -186,10 +186,14 @@
186 186
 #define PROGRESS_BAR_WIDTH (LCD_PIXEL_WIDTH - PROGRESS_BAR_X)
187 187
 
188 188
 FORCE_INLINE void _draw_centered_temp(const celsius_t temp, const uint8_t tx, const uint8_t ty) {
189
-  const char *str = i16tostr3rj(temp);
190
-  const uint8_t len = str[0] != ' ' ? 3 : str[1] != ' ' ? 2 : 1;
191
-  lcd_put_u8str(tx - len * (INFO_FONT_WIDTH) / 2 + 1, ty, &str[3-len]);
192
-  lcd_put_wchar(LCD_STR_DEGREE[0]);
189
+  if (temp < 0)
190
+    lcd_put_u8str(tx - 3 * (INFO_FONT_WIDTH) / 2 + 1, ty, "err");
191
+  else {
192
+    const char *str = i16tostr3rj(temp);
193
+    const uint8_t len = str[0] != ' ' ? 3 : str[1] != ' ' ? 2 : 1;
194
+    lcd_put_u8str(tx - len * (INFO_FONT_WIDTH) / 2 + 1, ty, &str[3-len]);
195
+    lcd_put_wchar(LCD_STR_DEGREE[0]);
196
+  }
193 197
 }
194 198
 
195 199
 #if DO_DRAW_FLOWMETER

Notiek ielāde…
Atcelt
Saglabāt