@@ -358,7 +358,9 @@ void PrintJobRecovery::write() {
358
358
* Resume the saved print job
359
359
*/
360
360
void PrintJobRecovery::resume () {
361
- const uint32_t resume_sdpos = info.sdpos ; // Get here before the stepper ISR overwrites it
361
+ // Get these fields before any moves because stepper.cpp overwrites them
362
+ const xyze_pos_t resume_pos = info.current_position ;
363
+ const uint32_t resume_sdpos = info.sdpos ;
362
364
363
365
// Apply the dry-run flag if enabled
364
366
if (info.flag .dryrun ) marlin_debug_flags |= MARLIN_DEBUG_DRYRUN;
@@ -400,7 +402,7 @@ void PrintJobRecovery::resume() {
400
402
#endif
401
403
402
404
// Interpret the saved Z according to flags
403
- const float z_print = info. current_position .z ,
405
+ const float z_print = resume_pos .z ,
404
406
z_raised = z_print + info.zraise ;
405
407
406
408
//
@@ -540,7 +542,7 @@ void PrintJobRecovery::resume() {
540
542
541
543
// Move back over to the saved XY
542
544
PROCESS_SUBCOMMANDS_NOW (TS (
543
- F (" G1F3000X" ), p_float_t (info. current_position . x , 3 ), ' Y' , p_float_t (info. current_position .y , 3 )
545
+ F (" G1F3000X" ), p_float_t (resume_pos. x , 3 ), ' Y' , p_float_t (resume_pos .y , 3 )
544
546
));
545
547
546
548
// Move back down to the saved Z for printing
@@ -550,7 +552,7 @@ void PrintJobRecovery::resume() {
550
552
PROCESS_SUBCOMMANDS_NOW (TS (F (" G1F" ), info.feedrate ));
551
553
552
554
// Restore E position with G92.9
553
- PROCESS_SUBCOMMANDS_NOW (TS (F (" G92.9E" ), p_float_t (info. current_position .e , 3 )));
555
+ PROCESS_SUBCOMMANDS_NOW (TS (F (" G92.9E" ), p_float_t (resume_pos .e , 3 )));
554
556
555
557
TERN_ (GCODE_REPEAT_MARKERS, repeat = info.stored_repeat );
556
558
TERN_ (HAS_HOME_OFFSET, home_offset = info.home_offset );
0 commit comments