Browse Source

Removed periodic refreshes

Fixes an issue where the LCD periodically flickers once in a while.
Kevin Lee 5 năm trước cách đây
mục cha
commit
2a0cbb48ff
1 tập tin đã thay đổi với 18 bổ sung16 xóa
  1. 18 16
      Firmware/ultralcd.cpp

+ 18 - 16
Firmware/ultralcd.cpp

@@ -62,7 +62,7 @@ static void lcd_mesh_bed_leveling_settings();
 static void lcd_backlight_menu();
 #endif
 
-int8_t ReInitLCD = 0;
+//int8_t ReInitLCD = 0;
 uint8_t scrollstuff = 0;
 
 int8_t SilentModeMenu = SILENT_MODE_OFF;
@@ -406,11 +406,11 @@ static uint8_t menu_item_sdfile(const char* str_fn, char* str_fnl)
 	return 0;
 }
 
-// Print temperature (nozzle/bed) (9 chars total)
-void lcdui_print_temp(char type, int val_current, int val_target)
+// Print temperature (nozzle/bed) (11 chars total)
+void lcdui_print_temp(char type, float val_current, int val_target)
 {
-	int chars = lcd_printf_P(_N("%c%3d/%d%c"), type, val_current, val_target, LCD_STR_DEGREE[0]);
-	lcd_space(9 - chars);
+	int chars = lcd_printf_P(_N("%c%5.1f/%d%c"), type, val_current, val_target, LCD_STR_DEGREE[0]);
+	lcd_space(11 - chars);
 }
 
 // Print Z-coordinate (8 chars total)
@@ -702,10 +702,11 @@ void lcdui_print_status_line(void)
 //! @brief Show Status Screen
 //!
 //! @code{.unparsed}
+//! ----------------------
 //! |01234567890123456789|
-//! |N 000/000D  Z000.0  |
-//! |B 000/000D  F100%   |
-//! |USB100% T0  t--:--  |
+//! |N000.0/000D  Z000.00|
+//! |B000.0/000D  F100%  |
+//! |USB100% T0   t--:-- |
 //! |Status line.........|
 //! ----------------------
 //! N - nozzle temp symbol	LCD_STR_THERMOMETER
@@ -716,23 +717,22 @@ void lcdui_print_status_line(void)
 //! @endcode
 void lcdui_print_status_screen(void)
 {
-
     lcd_set_cursor(0, 0); //line 0
 
-    //Print the hotend temperature (9 chars total)
-	lcdui_print_temp(LCD_STR_THERMOMETER[0], (int)(degHotend(0) + 0.5), (int)(degTargetHotend(0) + 0.5));
+    //Print the hotend temperature (11 chars total)
+	lcdui_print_temp(LCD_STR_THERMOMETER[0], degHotend(0), (int)(degTargetHotend(0) + 0.5));
 
-	lcd_space(3); //3 spaces
+	lcd_space(2); //2 spaces
 
     //Print Z-coordinate (8 chars total)
 	lcdui_print_Z_coord();
 
     lcd_set_cursor(0, 1); //line 1
 
-	//Print the Bed temperature (9 chars total)
-	lcdui_print_temp(LCD_STR_BEDTEMP[0], (int)(degBed() + 0.5), (int)(degTargetBed() + 0.5));
+	//Print the Bed temperature (11 chars total)
+	lcdui_print_temp(LCD_STR_BEDTEMP[0], degBed(), (int)(degTargetBed() + 0.5));
 
-	lcd_space(3); //3 spaces
+	lcd_space(2); //2 spaces
 
 #ifdef PLANNER_DIAGNOSTICS
 	//Print planner diagnostics (8 chars)
@@ -828,6 +828,7 @@ void lcd_status_screen()                          // NOT static due to using ins
 
 	if (lcd_draw_update)
 	{
+        /*
 		ReInitLCD++;
 		if (ReInitLCD == 30)
 		{
@@ -839,6 +840,7 @@ void lcd_status_screen()                          // NOT static due to using ins
 			if ((ReInitLCD % 10) == 0)
 				lcd_refresh_noclear(); //to maybe revive the LCD if static electricity killed it.
 		}
+        */
 
 		lcdui_print_status_screen();
 
@@ -4800,7 +4802,7 @@ static void wait_preheat()
 
         lcd_set_cursor(0, 4);
 	    //Print the hotend temperature (9 chars total)
-		lcdui_print_temp(LCD_STR_THERMOMETER[0], (int)(degHotend(0) + 0.5), (int)(degTargetHotend(0) + 0.5));
+		lcdui_print_temp(LCD_STR_THERMOMETER[0], degHotend(0), (int)(degTargetHotend(0) + 0.5));
         delay_keep_alive(1000);
     }