From d63a17c696d4c8f41537e816f3df0c707814ec57 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Tue, 22 May 2018 13:31:21 +0200 Subject: [PATCH] Safety timer not active during filament runout detection --- Firmware/Marlin.h | 3 +++ Firmware/Marlin_main.cpp | 30 ++++++++++++++++-------------- Firmware/ultralcd.cpp | 4 +--- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/Firmware/Marlin.h b/Firmware/Marlin.h index 5767b8b2..db1db3e4 100644 --- a/Firmware/Marlin.h +++ b/Firmware/Marlin.h @@ -347,6 +347,9 @@ extern bool sortAlpha; extern char dir_names[3][9]; +// save/restore printing +extern bool saved_printing; + extern void calculate_extruder_multipliers(); // Similar to the default Arduino delay function, diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 272cbcfe..8a3ca477 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -425,6 +425,10 @@ bool no_response = false; uint8_t important_status; uint8_t saved_filament_type; +// save/restore printing +bool saved_printing = false; + + //=========================================================================== //=============================Private Variables============================= //=========================================================================== @@ -477,6 +481,14 @@ unsigned long chdkHigh = 0; boolean chdkActive = false; #endif +// save/restore printing +static uint32_t saved_sdpos = 0; +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 bool saved_extruder_under_pressure = false; + //=========================================================================== //=============================Routines====================================== //=========================================================================== @@ -7139,7 +7151,7 @@ static void handleSafetyTimer() #error Implemented only for one extruder. #endif //(EXTRUDERS > 1) static Timer safetyTimer; - if (IS_SD_PRINTING || is_usb_printing || isPrintPaused || (custom_message_type == 4) + if (IS_SD_PRINTING || is_usb_printing || isPrintPaused || (custom_message_type == 4) || saved_printing || (lcd_commands_type == LCD_COMMAND_V2_CAL) || (!degTargetBed() && !degTargetHotend(0))) { safetyTimer.stop(); @@ -7148,11 +7160,11 @@ static void handleSafetyTimer() { safetyTimer.start(); } - else if (safetyTimer.expired(1800000ul)) + else if (safetyTimer.expired(1800000ul)) //30 min { setTargetBed(0); setTargetHotend(0, 0); - lcd_show_fullscreen_message_and_wait_P(MSG_BED_HEATING_SAFETY_DISABLED); + lcd_show_fullscreen_message_and_wait_P(MSG_BED_HEATING_SAFETY_DISABLED); } } #endif //SAFETYTIMER @@ -8400,17 +8412,7 @@ void restore_print_from_eeprom() { //////////////////////////////////////////////////////////////////////////////// -// new save/restore printing - -//extern uint32_t sdpos_atomic; - -bool saved_printing = false; -uint32_t saved_sdpos = 0; -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. -float saved_feedrate2 = 0; -uint8_t saved_active_extruder = 0; -bool saved_extruder_under_pressure = false; +// save/restore printing void stop_and_save_print_to_ram(float z_move, float e_move) { diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index f190149e..415a3b01 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -20,7 +20,7 @@ #ifdef PAT9125 #include "pat9125.h" -#endif //PAT9125 +#endif //PAT9125 #ifdef TMC2130 #include "tmc2130.h" @@ -5625,8 +5625,6 @@ void lcd_confirm_print() } -extern bool saved_printing; - static void lcd_main_menu() {