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.
This commit is contained in:
		| @@ -10992,12 +10992,6 @@ inline void gcode_M502() { | |||||||
|    *  Default values are used for omitted arguments. |    *  Default values are used for omitted arguments. | ||||||
|    */ |    */ | ||||||
|   inline void gcode_M600() { |   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; |     point_t park_point = NOZZLE_PARK_POINT; | ||||||
|  |  | ||||||
|     if (get_target_extruder_from_command(600)) return; |     if (get_target_extruder_from_command(600)) return; | ||||||
| @@ -11060,6 +11054,19 @@ inline void gcode_M502() { | |||||||
|     const bool job_running = print_job_timer.isRunning(); |     const bool job_running = print_job_timer.isRunning(); | ||||||
|  |  | ||||||
|     if (pause_print(retract, park_point, unload_length, true)) { |     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); |       wait_for_filament_reload(beep_count); | ||||||
|       resume_print(slow_load_length, fast_load_length, ADVANCED_PAUSE_PURGE_LENGTH, beep_count); |       resume_print(slow_load_length, fast_load_length, ADVANCED_PAUSE_PURGE_LENGTH, beep_count); | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -41,7 +41,7 @@ | |||||||
|    * Defines the version of the Marlin-AI3M build. Not to be confused with |    * Defines the version of the Marlin-AI3M build. Not to be confused with | ||||||
|    * Marlin's own build number, e.g. 1.1.9. |    * 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 |    * Verbose version identifier which should contain a reference to the location | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user