From 8fc01144f18727888a33fc37a91b23b80f32e967 Mon Sep 17 00:00:00 2001 From: David Ramiro Date: Sat, 23 Feb 2019 11:16:29 +0100 Subject: [PATCH] Set SDPAUSE state on M600 regardless of prior TFTstate Move the routine to a better position and set the state regardless of SDPRINT status. This ensures that M600 makes the display show a continue button every time. Before, it was only behaving correctly for the first instance of M600. --- Marlin/Marlin_main.cpp | 19 +++++++++++++------ Marlin/Version.h | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 00e7a58..82519fd 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -10992,12 +10992,6 @@ inline void gcode_M502() { * Default values are used for omitted arguments. */ inline void gcode_M600() { - #ifdef SDSUPPORT - if ((AnycubicTFT.TFTstate==ANYCUBIC_TFT_STATE_SDPRINT)){ - AnycubicTFT.TFTstate=ANYCUBIC_TFT_STATE_SDPAUSE_REQ; - AnycubicTFT.PausedByFilamentChange=true; - } - #endif point_t park_point = NOZZLE_PARK_POINT; if (get_target_extruder_from_command(600)) return; @@ -11060,6 +11054,19 @@ inline void gcode_M502() { const bool job_running = print_job_timer.isRunning(); if (pause_print(retract, park_point, unload_length, true)) { + #ifdef SDSUPPORT + #ifdef ANYCUBIC_TFT_DEBUG + SERIAL_ECHOLNPGM("DEBUG: Enter TFTstate routine"); + #endif + AnycubicTFT.TFTstate=ANYCUBIC_TFT_STATE_SDPAUSE_REQ; // enter correct display state to show resume button + #ifdef ANYCUBIC_TFT_DEBUG + SERIAL_ECHOLNPGM("DEBUG: Set TFTState to SDPAUSE_REQ"); + #endif + AnycubicTFT.PausedByFilamentChange=true; // set flag to ensure correct resume routine gets executed + #ifdef ANYCUBIC_TFT_DEBUG + SERIAL_ECHOLNPGM("DEBUG: Set filament change flag"); + #endif + #endif wait_for_filament_reload(beep_count); resume_print(slow_load_length, fast_load_length, ADVANCED_PAUSE_PURGE_LENGTH, beep_count); } diff --git a/Marlin/Version.h b/Marlin/Version.h index 2a79e7e..cfa63ed 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * Defines the version of the Marlin-AI3M build. Not to be confused with * Marlin's own build number, e.g. 1.1.9. */ - #define CUSTOM_BUILD_VERSION "v1.4.0" + #define CUSTOM_BUILD_VERSION "v1.4.1" /** * Verbose version identifier which should contain a reference to the location