From a5db084b705f24cc11e699b4ef0e083a56792374 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Tue, 4 Sep 2018 14:56:20 +0200 Subject: [PATCH] Move resuming nozzle temperature to restore_print_from_ram_and_continue(). Known limitations: Unused code not removed. Unload filament moves extruder to print position. --- Firmware/Marlin_main.cpp | 6 ++++++ Firmware/ultralcd.cpp | 27 +++++++-------------------- 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 80d14f3f..0e7d8e91 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -536,6 +536,7 @@ static float saved_pos[4] = { 0, 0, 0, 0 }; // Feedrate hopefully derived from an active block of the planner at the time the print has been canceled, in mm/min. static float saved_feedrate2 = 0; static uint8_t saved_active_extruder = 0; +static float saved_extruder_temperature = 0.0; static bool saved_extruder_under_pressure = false; static bool saved_extruder_relative_mode = false; static int saved_fanSpeed = 0; @@ -8743,6 +8744,7 @@ void stop_and_save_print_to_ram(float z_move, float e_move) planner_abort_hard(); //abort printing memcpy(saved_pos, current_position, sizeof(saved_pos)); saved_active_extruder = active_extruder; //save active_extruder + saved_extruder_temperature = degTargetHotend(active_extruder); saved_extruder_under_pressure = extruder_under_pressure; //extruder under pressure flag - currently unused saved_extruder_relative_mode = axis_relative_modes[E_AXIS]; @@ -8797,6 +8799,10 @@ void restore_print_from_ram_and_continue(float e_move) // for (int axis = X_AXIS; axis <= E_AXIS; axis++) // current_position[axis] = st_get_position_mm(axis); active_extruder = saved_active_extruder; //restore active_extruder + setTargetHotendSafe(saved_extruder_temperature,saved_active_extruder); + heating_status = 1; + wait_for_heater(millis(),saved_active_extruder); + heating_status = 2; feedrate = saved_feedrate2; //restore feedrate axis_relative_modes[E_AXIS] = saved_extruder_relative_mode; fanSpeed = saved_fanSpeed; diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 3a13fdae..a583f94b 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -5522,30 +5522,17 @@ static void lcd_test_menu() static void pause_print() { + lcd_clear(); + lcd_puts_P(_i("Pausing")); + lcd_setstatuspgm(_i("Print paused")); stop_and_save_print_to_ram(0.0,0.0); long_pause(); + lcd_return_to_status(); } static void resume_print() { - lcd_set_cursor(0, 0); - lcdui_print_temp(LCD_STR_THERMOMETER[0], (int)(degHotend(0) + 0.5), (int)(degTargetHotend(0) + 0.5)); - lcd_space(3); - lcd_puts_P(_T(MSG_HEATING)); - if (!blocks_queued()) - { - if ((0 == menu_data[0])) - { - char cmd1[30]; - strcpy(cmd1, "M109 S"); - strcat(cmd1, ftostr3(HotendTempBckp)); - enquecommand(cmd1); - menu_data[0] = 1; - } else if (1 != heating_status) - { - restore_print_from_ram_and_continue(0.0); - menu_back(); - } - } + lcd_return_to_status(); + restore_print_from_ram_and_continue(0.0); } static void lcd_main_menu() @@ -5645,7 +5632,7 @@ static void lcd_main_menu() } else { - MENU_ITEM_SUBMENU_P(_i("Resume print"), resume_print);////MSG_RESUME_PRINT c=0 r=0 + MENU_ITEM_SUBMENU_P(_i("Resume print"), resume_print);////MSG_RESUME_PRINT c=0 r=0 } MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); }