From 84ecf96be50a3af450bff5d506962ef0a0158f57 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Fri, 31 Jan 2020 15:08:24 +0100 Subject: [PATCH] Do not clear last print fail stats prematurely M24 was always cleaning the last print failstats. But because M24 is used to restore a print after power failure (by setting the seek offset), it would also reset the stats incorrectly after resuming. Check for the file index position and reset the stats only when a print is started from the beginning of the file. Apply the same logic to M32 and similarly handle the LA10->15 conversion (do not re-apply the adjustment for a resumed print). --- Firmware/Marlin_main.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index cd4ee63f4..62f93fae5 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -5576,10 +5576,15 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) lcd_resume_print(); else { - failstats_reset_print(); + if (!card.get_sdpos()) + { + // A new print has started from scratch, reset stats + failstats_reset_print(); #ifndef LA_NOCOMPAT - la10c_reset(); + la10c_reset(); #endif + } + card.startFileprint(); starttime=_millis(); } @@ -5689,12 +5694,19 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) if(code_seen('S')) if(strchr_pointer