Try to minimize auto screen clear/redraws

Re-enable M851 to use for adjusting Live-Z offset
This commit is contained in:
Ted Hess 2018-01-31 16:51:16 -05:00
parent bbf13db82a
commit 305d9d8dad
2 changed files with 30 additions and 37 deletions

View File

@ -467,7 +467,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
//=========================================================================== //===========================================================================
// Custom M code points // Custom M code points
//#define CUSTOM_M_CODES #define CUSTOM_M_CODES
#ifdef CUSTOM_M_CODES #ifdef CUSTOM_M_CODES
#define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
#define Z_PROBE_OFFSET_RANGE_MIN -15 #define Z_PROBE_OFFSET_RANGE_MIN -15

View File

@ -116,8 +116,6 @@ union Data
int value; int value;
}; };
int8_t ReInitLCD = 0;
int8_t SDscrool = 0; int8_t SDscrool = 0;
int8_t SilentModeMenu = 0; int8_t SilentModeMenu = 0;
@ -450,19 +448,9 @@ static void lcd_status_screen()
lcdDrawUpdate = 1; lcdDrawUpdate = 1;
if (lcdDrawUpdate) if (lcdDrawUpdate)
{ {
ReInitLCD++; // ***Note: Removed lcd reinit from here
// Re-init lcd every 30 re-draw updates (Why? Are things this un-reliable?) lcd_implementation_status_screen();
if (ReInitLCD == 30) {
lcd_implementation_init( // to maybe revive the LCD if static electricity killed it.
#if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT)
currentMenu == lcd_status_screen
#endif
);
ReInitLCD = 0 ;
}
lcd_implementation_status_screen();
if (farm_mode) if (farm_mode)
{ {
@ -6146,29 +6134,34 @@ void lcd_update(uint8_t lcdDrawUpdateOverride)
#endif #endif
#ifdef ULTIPANEL #ifdef ULTIPANEL
if (lcd_timeoutToStatus < millis() && currentMenu != lcd_status_screen) if (lcd_timeoutToStatus < millis() && currentMenu != lcd_status_screen)
{ {
// Exiting a menu. Let's call the menu function the last time with menuExiting flag set to true // Exiting a menu. Let's call the menu function the last time with menuExiting flag set to true
// to give it a chance to save its state. // to give it a chance to save its state.
// This is useful for example, when the babystep value has to be written into EEPROM. // This is useful for example, when the babystep value has to be written into EEPROM.
if (currentMenu != NULL) { if (currentMenu != NULL) {
menuExiting = true; menuExiting = true;
(*currentMenu)(); (*currentMenu)();
menuExiting = false; menuExiting = false;
} }
lcd_implementation_clear();
lcd_return_to_status(); lcd_return_to_status();
lcdDrawUpdate = 2; lcdDrawUpdate = 2;
} }
#endif//ULTIPANEL #endif//ULTIPANEL
if (lcdDrawUpdate == 2) lcd_implementation_clear(); if (lcdDrawUpdate == 2) lcd_implementation_clear();
if (lcdDrawUpdate) lcdDrawUpdate--; if (lcdDrawUpdate) lcdDrawUpdate--;
lcd_next_update_millis = millis() + LCD_UPDATE_INTERVAL; lcd_next_update_millis = millis() + LCD_UPDATE_INTERVAL;
} }
if (!SdFatUtil::test_stack_integrity()) stack_error();
lcd_ping(); //check that we have received ping command if we are in farm mode if (!SdFatUtil::test_stack_integrity())
lcd_send_status(); stack_error();
if (lcd_commands_type == LCD_COMMAND_V2_CAL) lcd_commands();
lcd_ping(); //check that we have received ping command if we are in farm mode
lcd_send_status();
if (lcd_commands_type == LCD_COMMAND_V2_CAL)
lcd_commands();
} }
void lcd_printer_connected() { void lcd_printer_connected() {