From 773a550472d69b081a39deb8d99cb7cf7c32d14f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 22 May 2018 21:42:58 -0500 Subject: [PATCH] Fix fade value for power-loss recovery Fix #10817 Co-Authored-By: cdedwards --- Marlin/power_loss_recovery.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Marlin/power_loss_recovery.cpp b/Marlin/power_loss_recovery.cpp index 5b5948b924..023c1c25cb 100644 --- a/Marlin/power_loss_recovery.cpp +++ b/Marlin/power_loss_recovery.cpp @@ -127,13 +127,15 @@ void do_print_job_recovery() { #endif )); + char str_1[16], str_2[16]; + #if HAS_LEVELING // Restore leveling state before G92 sets Z // This ensures the steppers correspond to the native Z - sprintf_P(job_recovery_commands[ind++], PSTR("M420 S%i Z%s"), int(job_recovery_info.leveling), job_recovery_info.fade); + dtostrf(job_recovery_info.fade, 1, 1, str_1); + sprintf_P(job_recovery_commands[ind++], PSTR("M420 S%i Z%s"), int(job_recovery_info.leveling), str_1); #endif - char str_1[16], str_2[16]; dtostrf(job_recovery_info.current_position[Z_AXIS] + 2, 1, 3, str_1); dtostrf(job_recovery_info.current_position[E_AXIS] #if ENABLED(SAVE_EACH_CMD_MODE)