diff --git a/Marlin/AnycubicTFT.h b/Marlin/AnycubicTFT.h index ccc465b..227be08 100644 --- a/Marlin/AnycubicTFT.h +++ b/Marlin/AnycubicTFT.h @@ -55,6 +55,9 @@ public: void HeatingStart(); void FilamentRunout(); void KillTFT(); + char TFTstate=ANYCUBIC_TFT_STATE_IDLE; + bool PausedByRunout=false; + bool PausedByFilamentChange=false; private: char TFTcmdbuffer[TFTBUFSIZE][TFT_MAX_CMD_SIZE]; @@ -64,7 +67,6 @@ private: char serial3_char; int serial3_count = 0; char *TFTstrchr_pointer; - char TFTstate=ANYCUBIC_TFT_STATE_IDLE; char FlagResumFromOutage=0; uint16_t filenumber=0; unsigned long starttime=0; @@ -72,8 +74,6 @@ private: uint8_t tmp_extruder=0; char LastSDstatus=0; uint16_t HeaterCheckCount=0; - bool PausedByRunout=false; - bool PausedByFilamentChange=false; struct OutageDataStruct { char OutageDataVersion; diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index e3e1dd7..3db125f 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -10992,6 +10992,12 @@ 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;