|
@@ -54,7 +54,6 @@ static float resume_position[XYZE];
|
54
|
54
|
|
55
|
55
|
#if ENABLED(SDSUPPORT)
|
56
|
56
|
#include "../sd/cardreader.h"
|
57
|
|
- static bool sd_print_paused = false;
|
58
|
57
|
#endif
|
59
|
58
|
|
60
|
59
|
#if HAS_BUZZER
|
|
@@ -107,12 +106,12 @@ void do_pause_e_move(const float &length, const float fr) {
|
107
|
106
|
|
108
|
107
|
// public:
|
109
|
108
|
|
110
|
|
-bool move_away_flag = false;
|
|
109
|
+uint8_t did_pause_print = 0;
|
111
|
110
|
|
112
|
111
|
bool pause_print(const float &retract, const point_t &park_point, const float &unload_length/*=0*/,
|
113
|
112
|
const int8_t max_beep_count/*=0*/, const bool show_lcd/*=false*/
|
114
|
113
|
) {
|
115
|
|
- if (move_away_flag) return false; // already paused
|
|
114
|
+ if (did_pause_print) return false; // already paused
|
116
|
115
|
|
117
|
116
|
#ifdef ACTION_ON_PAUSE
|
118
|
117
|
SERIAL_ECHOLNPGM("//action:" ACTION_ON_PAUSE);
|
|
@@ -132,13 +131,13 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u
|
132
|
131
|
}
|
133
|
132
|
|
134
|
133
|
// Indicate that the printer is paused
|
135
|
|
- move_away_flag = true;
|
|
134
|
+ ++did_pause_print;
|
136
|
135
|
|
137
|
136
|
// Pause the print job and timer
|
138
|
137
|
#if ENABLED(SDSUPPORT)
|
139
|
138
|
if (IS_SD_PRINTING) {
|
140
|
139
|
card.pauseSDPrint();
|
141
|
|
- sd_print_paused = true;
|
|
140
|
+ ++did_pause_print;
|
142
|
141
|
}
|
143
|
142
|
#endif
|
144
|
143
|
print_job_timer.pause();
|
|
@@ -256,7 +255,7 @@ void wait_for_filament_reload(const int8_t max_beep_count/*=0*/) {
|
256
|
255
|
void resume_print(const float &load_length/*=0*/, const float &initial_extrude_length/*=0*/, const int8_t max_beep_count/*=0*/) {
|
257
|
256
|
bool nozzle_timed_out = false;
|
258
|
257
|
|
259
|
|
- if (!move_away_flag) return;
|
|
258
|
+ if (!did_pause_print) return;
|
260
|
259
|
|
261
|
260
|
// Re-enable the heaters if they timed out
|
262
|
261
|
HOTEND_LOOP() {
|
|
@@ -350,14 +349,14 @@ void resume_print(const float &load_length/*=0*/, const float &initial_extrude_l
|
350
|
349
|
SERIAL_ECHOLNPGM("//action:" ACTION_ON_RESUME);
|
351
|
350
|
#endif
|
352
|
351
|
|
|
352
|
+ --did_pause_print;
|
|
353
|
+
|
353
|
354
|
#if ENABLED(SDSUPPORT)
|
354
|
|
- if (sd_print_paused) {
|
|
355
|
+ if (did_pause_print) {
|
355
|
356
|
card.startFileprint();
|
356
|
|
- sd_print_paused = false;
|
|
357
|
+ --did_pause_print;
|
357
|
358
|
}
|
358
|
359
|
#endif
|
359
|
|
-
|
360
|
|
- move_away_flag = false;
|
361
|
360
|
}
|
362
|
361
|
|
363
|
362
|
#endif // ADVANCED_PAUSE_FEATURE || PARK_HEAD_ON_PAUSE
|