From 6e041b9c612da529391a8eaff3081750fd0e2fd3 Mon Sep 17 00:00:00 2001 From: MasterPIC Date: Thu, 1 Nov 2018 21:56:12 +0100 Subject: [PATCH] Use blink to show more info on LCD (#12256) --- .../src/lcd/HD44780/ultralcd_impl_HD44780.cpp | 35 ++++++++++++++----- Marlin/src/lcd/dogm/status_screen_DOGM.cpp | 2 +- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/Marlin/src/lcd/HD44780/ultralcd_impl_HD44780.cpp b/Marlin/src/lcd/HD44780/ultralcd_impl_HD44780.cpp index 3e6cbebc06..a438bda413 100644 --- a/Marlin/src/lcd/HD44780/ultralcd_impl_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/ultralcd_impl_HD44780.cpp @@ -848,19 +848,38 @@ FORCE_INLINE void _draw_status_message(const bool blink) { lcd_put_u8str(itostr3(feedrate_percentage)); lcd_put_wchar('%'); - #if LCD_WIDTH >= 20 && HAS_PRINT_PROGRESS - lcd_moveto(7, 2); - _draw_print_progress(); - #endif - char buffer[14]; duration_t elapsed = print_job_timer.duration(); - uint8_t len = elapsed.toDigital(buffer); - - lcd_moveto(LCD_WIDTH - len - 1, 2); + const uint8_t len = elapsed.toDigital(buffer), + timepos = LCD_WIDTH - len - 1; + lcd_moveto(timepos, 2); lcd_put_wchar(LCD_CLOCK_CHAR); lcd_put_u8str(buffer); + #if LCD_WIDTH >= 20 + lcd_moveto(timepos - 7, 2); + #if HAS_PRINT_PROGRESS + _draw_print_progress(); + #else + #if HAS_FAN0 + char c; + int per; + if (blink) { + c = 'F'; + per = ((int(fan_speed[0]) + 1) * 100) / 256; + } + else + #endif + { + c = 'E'; + per = planner.flow_percentage[0]; + } + lcd_put_wchar(c); + lcd_put_u8str(itostr3(per)); + lcd_put_wchar('%'); + #endif + #endif + #endif // LCD_HEIGHT > 3 // ========= Last Line ======== diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index 52e6f96a8c..d5462c9164 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -282,7 +282,7 @@ void lcd_impl_status_screen_0() { #if HAS_FAN0 if (PAGE_CONTAINS(STATUS_SCREEN_FAN_TEXT_Y - 7, STATUS_SCREEN_FAN_TEXT_Y)) { // Fan - const uint16_t per = (((uint16_t)fan_speed[0] + 1) * 100) / 256; + const int per = ((int(fan_speed[0]) + 1) * 100) / 256; if (per) { lcd_moveto(STATUS_SCREEN_FAN_TEXT_X, STATUS_SCREEN_FAN_TEXT_Y); lcd_put_u8str(itostr3(per));