Heater error status

This commit is contained in:
Scott Lahteine 2021-04-30 03:21:59 -05:00
parent d5c6762332
commit f6b0398ca8
2 changed files with 9 additions and 5 deletions

View File

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

View File

@ -186,11 +186,15 @@
#define PROGRESS_BAR_WIDTH (LCD_PIXEL_WIDTH - PROGRESS_BAR_X)
FORCE_INLINE void _draw_centered_temp(const celsius_t temp, const uint8_t tx, const uint8_t ty) {
if (temp < 0)
lcd_put_u8str(tx - 3 * (INFO_FONT_WIDTH) / 2 + 1, ty, "err");
else {
const char *str = i16tostr3rj(temp);
const uint8_t len = str[0] != ' ' ? 3 : str[1] != ' ' ? 2 : 1;
lcd_put_u8str(tx - len * (INFO_FONT_WIDTH) / 2 + 1, ty, &str[3-len]);
lcd_put_wchar(LCD_STR_DEGREE[0]);
}
}
#if DO_DRAW_FLOWMETER
FORCE_INLINE void _draw_centered_flowrate(const float flow, const uint8_t tx, const uint8_t ty) {