Merge pull request #760 from PavelSindler/safety_timer_fixes
Safety timer not active during filament runout procedure
This commit is contained in:
commit
28a767b460
4 changed files with 22 additions and 16 deletions
|
@ -347,6 +347,9 @@ extern bool sortAlpha;
|
||||||
|
|
||||||
extern char dir_names[3][9];
|
extern char dir_names[3][9];
|
||||||
|
|
||||||
|
// save/restore printing
|
||||||
|
extern bool saved_printing;
|
||||||
|
|
||||||
extern void calculate_extruder_multipliers();
|
extern void calculate_extruder_multipliers();
|
||||||
|
|
||||||
// Similar to the default Arduino delay function,
|
// Similar to the default Arduino delay function,
|
||||||
|
|
|
@ -425,6 +425,10 @@ bool no_response = false;
|
||||||
uint8_t important_status;
|
uint8_t important_status;
|
||||||
uint8_t saved_filament_type;
|
uint8_t saved_filament_type;
|
||||||
|
|
||||||
|
// save/restore printing
|
||||||
|
bool saved_printing = false;
|
||||||
|
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
//=============================Private Variables=============================
|
//=============================Private Variables=============================
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
@ -477,6 +481,14 @@ unsigned long chdkHigh = 0;
|
||||||
boolean chdkActive = false;
|
boolean chdkActive = false;
|
||||||
#endif
|
#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======================================
|
//=============================Routines======================================
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
@ -7160,7 +7172,7 @@ static void handleSafetyTimer()
|
||||||
#error Implemented only for one extruder.
|
#error Implemented only for one extruder.
|
||||||
#endif //(EXTRUDERS > 1)
|
#endif //(EXTRUDERS > 1)
|
||||||
static Timer safetyTimer;
|
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)))
|
|| (lcd_commands_type == LCD_COMMAND_V2_CAL) || (!degTargetBed() && !degTargetHotend(0)))
|
||||||
{
|
{
|
||||||
safetyTimer.stop();
|
safetyTimer.stop();
|
||||||
|
@ -7169,7 +7181,7 @@ static void handleSafetyTimer()
|
||||||
{
|
{
|
||||||
safetyTimer.start();
|
safetyTimer.start();
|
||||||
}
|
}
|
||||||
else if (safetyTimer.expired(1800000ul))
|
else if (safetyTimer.expired(1800000ul)) //30 min
|
||||||
{
|
{
|
||||||
setTargetBed(0);
|
setTargetBed(0);
|
||||||
setTargetHotend(0, 0);
|
setTargetHotend(0, 0);
|
||||||
|
@ -8421,17 +8433,7 @@ void restore_print_from_eeprom() {
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// new save/restore printing
|
// 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;
|
|
||||||
|
|
||||||
void stop_and_save_print_to_ram(float z_move, float e_move)
|
void stop_and_save_print_to_ram(float z_move, float e_move)
|
||||||
{
|
{
|
||||||
|
|
|
@ -523,7 +523,10 @@ void CardReader::getStatus()
|
||||||
SERIAL_PROTOCOL(itostr2(time%60));
|
SERIAL_PROTOCOL(itostr2(time%60));
|
||||||
SERIAL_PROTOCOLPGM("\n");
|
SERIAL_PROTOCOLPGM("\n");
|
||||||
}
|
}
|
||||||
else{
|
else if (saved_printing) {
|
||||||
|
SERIAL_PROTOCOLLNPGM("Print saved");
|
||||||
|
}
|
||||||
|
else {
|
||||||
SERIAL_PROTOCOLLNPGM("Not SD printing");
|
SERIAL_PROTOCOLLNPGM("Not SD printing");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5651,8 +5651,6 @@ void lcd_confirm_print()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extern bool saved_printing;
|
|
||||||
|
|
||||||
static void lcd_main_menu()
|
static void lcd_main_menu()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue