From cd1ef33c8c9977f0299c09ee4de792f1f0a27e5b Mon Sep 17 00:00:00 2001 From: Robby Candra Date: Fri, 5 Apr 2019 10:47:00 +0700 Subject: [PATCH] Drop extra PLR save test (#13554) --- Marlin/src/feature/power_loss_recovery.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Marlin/src/feature/power_loss_recovery.cpp b/Marlin/src/feature/power_loss_recovery.cpp index a16218c29a..a17e80ef3f 100644 --- a/Marlin/src/feature/power_loss_recovery.cpp +++ b/Marlin/src/feature/power_loss_recovery.cpp @@ -126,8 +126,6 @@ void PrintJobRecovery::save(const bool force/*=false*/, const bool save_queue/*= #endif // Did Z change since the last call? - const float zmoved = current_position[Z_AXIS] - info.current_position[Z_AXIS]; - if (force #if DISABLED(SAVE_EACH_CMD_MODE) // Always save state when enabled #if PIN_EXISTS(POWER_LOSS) // Save if power loss pin is triggered @@ -136,8 +134,8 @@ void PrintJobRecovery::save(const bool force/*=false*/, const bool save_queue/*= #if SAVE_INFO_INTERVAL_MS > 0 // Save if interval is elapsed || ELAPSED(ms, next_save_ms) #endif - || zmoved > 0 // Z moved up (including Z-hop) - || zmoved < -5 // Z moved down a lot (for some reason) + // Save every time Z is higher than the last call + || current_position[Z_AXIS] > info.current_position[Z_AXIS] #endif ) { @@ -375,8 +373,8 @@ void PrintJobRecovery::resume() { if (info.valid_head == info.valid_foot) { SERIAL_ECHOPGM("current_position: "); LOOP_XYZE(i) { + if (i) SERIAL_CHAR(','); SERIAL_ECHO(info.current_position[i]); - if (i < E_AXIS) SERIAL_CHAR(','); } SERIAL_EOL(); SERIAL_ECHOLNPAIR("feedrate: ", info.feedrate);