From c185b46eb25a3d599e80e4601f2b0995b32221a5 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Wed, 10 Jan 2018 23:28:41 +0100 Subject: [PATCH] live adjust Z saving using timeout --- Firmware/Marlin_main.cpp | 1 + Firmware/ultralcd.cpp | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 996ec118..d19a9828 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -1058,6 +1058,7 @@ void setup() // EEPROM_LANG to number lower than 0x0ff. // 1) Set a high power mode. eeprom_write_byte((uint8_t*)EEPROM_SILENT, 0); + eeprom_write_byte((uint8_t*)EEPROM_CALIBRATION_STATUS, CALIBRATION_STATUS_LIVE_ADJUST); eeprom_write_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); //run wizard } diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 6943c416..7fc8cde9 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -651,7 +651,7 @@ void lcd_commands() float extr = count_e(0.2, width, length); float extr_short_segment = count_e(0.2, width, width); - lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS; + if (lcd_commands_step>1) lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS; //if user dont confirm live adjust Z value by pressing the knob, we are saving last value by timeout to status screen if (lcd_commands_step == 0) { lcd_commands_step = 10; @@ -915,7 +915,7 @@ void lcd_commands() float length = 20 - width; float extr = count_e(0.2, width, length); float extr_short_segment = count_e(0.2, width, width); - lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS; + if(lcd_commands_step>1) lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS; //if user dont confirm live adjust Z value by pressing the knob, we are saving last value by timeout to status screen if (lcd_commands_step == 0) { lcd_commands_step = 9; @@ -3703,7 +3703,6 @@ void lcd_wizard(int state) { if (wizard_event) { //reset status and live adjust z value in eeprom calibration_status_store(CALIBRATION_STATUS_LIVE_ADJUST); - EEPROM_save_B(EEPROM_BABYSTEP_Z, 0); lcd_show_fullscreen_message_and_wait_P(MSG_WIZARD_CLEAN_HEATBED); state = 9; } @@ -6666,7 +6665,7 @@ void lcd_update(uint8_t lcdDrawUpdateOverride) // 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. // This is useful for example, when the babystep value has to be written into EEPROM. - if (currentMenu != NULL) { + if (currentMenu != NULL) { menuExiting = true; (*currentMenu)(); menuExiting = false;