Merge pull request #431 from PavelSindler/fan_error_resume

SD card long pause update
This commit is contained in:
XPila 2018-01-24 00:12:33 +01:00 committed by GitHub
commit 975ed14cb6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 8 deletions

View file

@ -662,8 +662,7 @@ void crashdet_detected()
lcd_setstatuspgm(MSG_CRASH_DETECTED); lcd_setstatuspgm(MSG_CRASH_DETECTED);
if (yesno) if (yesno)
{ {
enquecommand_P(PSTR("G28 X")); enquecommand_P(PSTR("G28 X Y"));
enquecommand_P(PSTR("G28 Y"));
enquecommand_P(PSTR("CRASH_RECOVER")); enquecommand_P(PSTR("CRASH_RECOVER"));
} }
else else

View file

@ -576,12 +576,17 @@ void lcd_commands()
if (lcd_commands_type == LCD_COMMAND_LONG_PAUSE) if (lcd_commands_type == LCD_COMMAND_LONG_PAUSE)
{ {
if(lcd_commands_step == 0) { if(lcd_commands_step == 0) {
card.pauseSDPrint(); if (card.sdprinting) {
lcd_setstatuspgm(MSG_FINISHING_MOVEMENTS); card.pauseSDPrint();
lcdDrawUpdate = 3; lcd_setstatuspgm(MSG_FINISHING_MOVEMENTS);
lcd_commands_step = 1; lcdDrawUpdate = 3;
lcd_commands_step = 1;
}
else {
lcd_commands_type = 0;
}
} }
if (lcd_commands_step == 1 && !blocks_queued()) { if (lcd_commands_step == 1 && !blocks_queued() && !homing_flag) {
lcd_setstatuspgm(MSG_PRINT_PAUSED); lcd_setstatuspgm(MSG_PRINT_PAUSED);
isPrintPaused = true; isPrintPaused = true;
long_pause(); long_pause();
@ -598,7 +603,7 @@ void lcd_commands()
lcdDrawUpdate = 3; lcdDrawUpdate = 3;
lcd_commands_step = 4; lcd_commands_step = 4;
} }
if (lcd_commands_step == 1 && !blocks_queued()) { //recover feedmultiply if (lcd_commands_step == 1 && !blocks_queued() && cmd_buffer_empty()) { //recover feedmultiply; cmd_buffer_empty() ensures that card.sdprinting is synchronized with buffered commands and thus print cant be paused until resume is finished
sprintf_P(cmd1, PSTR("M220 S%d"), saved_feedmultiply); sprintf_P(cmd1, PSTR("M220 S%d"), saved_feedmultiply);
enquecommand(cmd1); enquecommand(cmd1);