Skip to content

Commit fbe3a97

Browse files
committed
tweak, no "err°"
1 parent c3f38f4 commit fbe3a97

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

Marlin/src/lcd/dogm/status_screen_DOGM.cpp

+6-10
Original file line numberDiff line numberDiff line change
@@ -192,18 +192,14 @@
192192
#define PROGRESS_BAR_WIDTH (LCD_PIXEL_WIDTH - PROGRESS_BAR_X)
193193

194194
FORCE_INLINE void _draw_centered_temp(const celsius_t temp, const uint8_t tx, const uint8_t ty) {
195-
const char *str;
196-
uint8_t len;
197195
if (temp > 0) {
198-
str = i16tostr3rj(temp);
199-
len = str[0] != ' ' ? 3 : str[1] != ' ' ? 2 : 1;
196+
const char *str = i16tostr3left(temp);
197+
uint8_t len = strlen(str);
198+
lcd_put_u8str(tx - len * (INFO_FONT_WIDTH) / 2 + 1, ty, str);
199+
lcd_put_lchar(LCD_STR_DEGREE[0]);
200200
}
201-
else {
202-
str = "err";
203-
len = 3;
204-
}
205-
lcd_put_u8str(tx - len * (INFO_FONT_WIDTH) / 2 + 1, ty, &str[3-len]);
206-
if (temp > 0) lcd_put_lchar(LCD_STR_DEGREE[0]);
201+
else
202+
lcd_put_u8str(tx - len * (INFO_FONT_WIDTH) / 2 + 1, ty, F("err"));
207203
}
208204

209205
#if DO_DRAW_FLOWMETER

0 commit comments

Comments
 (0)