Skip to content

Commit

Permalink
Set SDPAUSE state on M600 regardless of prior TFTstate
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
davidramiro committed Feb 23, 2019
1 parent 8448c67 commit 8fc0114
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
19 changes: 13 additions & 6 deletions Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion Marlin/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8fc0114

Please sign in to comment.