My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pause.cpp 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Based on Sprinter and grbl.
  6. * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. /**
  23. * feature/pause.cpp - Pause feature support functions
  24. * This may be combined with related G-codes if features are consolidated.
  25. */
  26. #include "../inc/MarlinConfigPre.h"
  27. #if ENABLED(ADVANCED_PAUSE_FEATURE)
  28. #include "../Marlin.h"
  29. #include "../gcode/gcode.h"
  30. #include "../module/motion.h"
  31. #include "../module/planner.h"
  32. #include "../module/stepper.h"
  33. #include "../module/printcounter.h"
  34. #include "../module/temperature.h"
  35. #if ENABLED(FWRETRACT)
  36. #include "fwretract.h"
  37. #endif
  38. #if ENABLED(FILAMENT_RUNOUT_SENSOR)
  39. #include "runout.h"
  40. #endif
  41. #include "../lcd/ultralcd.h"
  42. #include "../libs/buzzer.h"
  43. #include "../libs/nozzle.h"
  44. #include "pause.h"
  45. // private:
  46. static float resume_position[XYZE];
  47. AdvancedPauseMenuResponse advanced_pause_menu_response;
  48. fil_change_settings_t fc_settings[EXTRUDERS];
  49. #if ENABLED(SDSUPPORT)
  50. #include "../sd/cardreader.h"
  51. #endif
  52. #if HAS_BUZZER
  53. static void filament_change_beep(const int8_t max_beep_count, const bool init=false) {
  54. static millis_t next_buzz = 0;
  55. static int8_t runout_beep = 0;
  56. if (init) next_buzz = runout_beep = 0;
  57. const millis_t ms = millis();
  58. if (ELAPSED(ms, next_buzz)) {
  59. if (max_beep_count < 0 || runout_beep < max_beep_count + 5) { // Only beep as long as we're supposed to
  60. next_buzz = ms + ((max_beep_count < 0 || runout_beep < max_beep_count) ? 1000 : 500);
  61. BUZZ(50, 880 - (runout_beep & 1) * 220);
  62. runout_beep++;
  63. }
  64. }
  65. }
  66. #endif
  67. /**
  68. * Ensure a safe temperature for extrusion
  69. *
  70. * - Fail if the TARGET temperature is too low
  71. * - Display LCD placard with temperature status
  72. * - Return when heating is done or aborted
  73. *
  74. * Returns 'true' if heating was completed, 'false' for abort
  75. */
  76. static bool ensure_safe_temperature(const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_SAME) {
  77. #if ENABLED(PREVENT_COLD_EXTRUSION)
  78. if (!DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(active_extruder)) {
  79. SERIAL_ECHO_MSG(MSG_ERR_HOTEND_TOO_COLD);
  80. return false;
  81. }
  82. #endif
  83. #if HAS_LCD_MENU
  84. lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_HEATING, mode);
  85. #else
  86. UNUSED(mode);
  87. #endif
  88. return thermalManager.wait_for_hotend(active_extruder);
  89. }
  90. void do_pause_e_move(const float &length, const float &fr) {
  91. current_position[E_AXIS] += length / planner.e_factor[active_extruder];
  92. planner.buffer_line(current_position, fr, active_extruder);
  93. planner.synchronize();
  94. }
  95. /**
  96. * Load filament into the hotend
  97. *
  98. * - Fail if the a safe temperature was not reached
  99. * - If pausing for confirmation, wait for a click or M108
  100. * - Show "wait for load" placard
  101. * - Load and purge filament
  102. * - Show "Purge more" / "Continue" menu
  103. * - Return when "Continue" is selected
  104. *
  105. * Returns 'true' if load was completed, 'false' for abort
  106. */
  107. bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_length/*=0*/, const float &purge_length/*=0*/, const int8_t max_beep_count/*=0*/,
  108. const bool show_lcd/*=false*/, const bool pause_for_user/*=false*/,
  109. const AdvancedPauseMode mode/*=ADVANCED_PAUSE_MODE_PAUSE_PRINT*/
  110. DXC_ARGS
  111. ) {
  112. if (!ensure_safe_temperature(mode)) {
  113. #if HAS_LCD_MENU
  114. if (show_lcd) lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS, mode);
  115. #endif
  116. return false;
  117. }
  118. if (pause_for_user) {
  119. #if HAS_LCD_MENU
  120. if (show_lcd) lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INSERT, mode);
  121. #endif
  122. SERIAL_ECHO_MSG(MSG_FILAMENT_CHANGE_INSERT);
  123. #if HAS_BUZZER
  124. filament_change_beep(max_beep_count, true);
  125. #else
  126. UNUSED(max_beep_count);
  127. #endif
  128. KEEPALIVE_STATE(PAUSED_FOR_USER);
  129. wait_for_user = true; // LCD click or M108 will clear this
  130. while (wait_for_user) {
  131. #if HAS_BUZZER
  132. filament_change_beep(max_beep_count);
  133. #endif
  134. idle(true);
  135. }
  136. KEEPALIVE_STATE(IN_HANDLER);
  137. }
  138. #if HAS_LCD_MENU
  139. if (show_lcd) lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_LOAD, mode);
  140. #else
  141. UNUSED(show_lcd);
  142. #endif
  143. #if ENABLED(DUAL_X_CARRIAGE)
  144. const int8_t saved_ext = active_extruder;
  145. const bool saved_ext_dup_mode = extruder_duplication_enabled;
  146. active_extruder = DXC_ext;
  147. extruder_duplication_enabled = false;
  148. #endif
  149. // Slow Load filament
  150. if (slow_load_length) do_pause_e_move(slow_load_length, FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE);
  151. // Fast Load Filament
  152. if (fast_load_length) {
  153. #if FILAMENT_CHANGE_FAST_LOAD_ACCEL > 0
  154. const float saved_acceleration = planner.settings.retract_acceleration;
  155. planner.settings.retract_acceleration = FILAMENT_CHANGE_FAST_LOAD_ACCEL;
  156. #endif
  157. do_pause_e_move(fast_load_length, FILAMENT_CHANGE_FAST_LOAD_FEEDRATE);
  158. #if FILAMENT_CHANGE_FAST_LOAD_ACCEL > 0
  159. planner.settings.retract_acceleration = saved_acceleration;
  160. #endif
  161. }
  162. #if ENABLED(DUAL_X_CARRIAGE) // Tie the two extruders movement back together.
  163. active_extruder = saved_ext;
  164. extruder_duplication_enabled = saved_ext_dup_mode;
  165. stepper.set_directions();
  166. #endif
  167. #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE)
  168. #if HAS_LCD_MENU
  169. if (show_lcd) lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_PURGE);
  170. #endif
  171. wait_for_user = true;
  172. for (float purge_count = purge_length; purge_count > 0 && wait_for_user; --purge_count)
  173. do_pause_e_move(1, ADVANCED_PAUSE_PURGE_FEEDRATE);
  174. wait_for_user = false;
  175. #else
  176. do {
  177. if (purge_length > 0) {
  178. // "Wait for filament purge"
  179. #if HAS_LCD_MENU
  180. if (show_lcd) lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_PURGE);
  181. #endif
  182. // Extrude filament to get into hotend
  183. do_pause_e_move(purge_length, ADVANCED_PAUSE_PURGE_FEEDRATE);
  184. }
  185. // Show "Purge More" / "Resume" menu and wait for reply
  186. #if HAS_LCD_MENU
  187. if (show_lcd) {
  188. KEEPALIVE_STATE(PAUSED_FOR_USER);
  189. wait_for_user = false;
  190. lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_OPTION);
  191. while (advanced_pause_menu_response == ADVANCED_PAUSE_RESPONSE_WAIT_FOR) idle(true);
  192. KEEPALIVE_STATE(IN_HANDLER);
  193. }
  194. #endif
  195. // Keep looping if "Purge More" was selected
  196. } while (false
  197. #if HAS_LCD_MENU
  198. && show_lcd && advanced_pause_menu_response == ADVANCED_PAUSE_RESPONSE_EXTRUDE_MORE
  199. #endif
  200. );
  201. #endif
  202. return true;
  203. }
  204. /**
  205. * Unload filament from the hotend
  206. *
  207. * - Fail if the a safe temperature was not reached
  208. * - Show "wait for unload" placard
  209. * - Retract, pause, then unload filament
  210. * - Disable E stepper (on most machines)
  211. *
  212. * Returns 'true' if unload was completed, 'false' for abort
  213. */
  214. bool unload_filament(const float &unload_length, const bool show_lcd/*=false*/,
  215. const AdvancedPauseMode mode/*=ADVANCED_PAUSE_MODE_PAUSE_PRINT*/
  216. ) {
  217. if (!ensure_safe_temperature(mode)) {
  218. #if HAS_LCD_MENU
  219. if (show_lcd) lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS);
  220. #endif
  221. return false;
  222. }
  223. #if HAS_LCD_MENU
  224. if (show_lcd) lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_UNLOAD, mode);
  225. #else
  226. UNUSED(show_lcd);
  227. #endif
  228. // Retract filament
  229. do_pause_e_move(-FILAMENT_UNLOAD_RETRACT_LENGTH, PAUSE_PARK_RETRACT_FEEDRATE);
  230. // Wait for filament to cool
  231. safe_delay(FILAMENT_UNLOAD_DELAY);
  232. // Quickly purge
  233. do_pause_e_move(FILAMENT_UNLOAD_RETRACT_LENGTH + FILAMENT_UNLOAD_PURGE_LENGTH, planner.settings.max_feedrate_mm_s[E_AXIS]);
  234. // Unload filament
  235. #if FILAMENT_CHANGE_UNLOAD_ACCEL > 0
  236. const float saved_acceleration = planner.settings.retract_acceleration;
  237. planner.settings.retract_acceleration = FILAMENT_CHANGE_UNLOAD_ACCEL;
  238. #endif
  239. do_pause_e_move(unload_length, FILAMENT_CHANGE_UNLOAD_FEEDRATE);
  240. #if FILAMENT_CHANGE_FAST_LOAD_ACCEL > 0
  241. planner.settings.retract_acceleration = saved_acceleration;
  242. #endif
  243. // Disable extruders steppers for manual filament changing (only on boards that have separate ENABLE_PINS)
  244. #if (E0_ENABLE_PIN != X_ENABLE_PIN && E1_ENABLE_PIN != Y_ENABLE_PIN) || AXIS_DRIVER_TYPE_E0(TMC2660) || AXIS_DRIVER_TYPE_E1(TMC2660) || AXIS_DRIVER_TYPE_E2(TMC2660) || AXIS_DRIVER_TYPE_E3(TMC2660) || AXIS_DRIVER_TYPE_E4(TMC2660) || AXIS_DRIVER_TYPE_E5(TMC2660)
  245. disable_e_stepper(active_extruder);
  246. safe_delay(100);
  247. #endif
  248. return true;
  249. }
  250. // public:
  251. /**
  252. * Pause procedure
  253. *
  254. * - Abort if already paused
  255. * - Send host action for pause, if configured
  256. * - Abort if TARGET temperature is too low
  257. * - Display "wait for start of filament change" (if a length was specified)
  258. * - Initial retract, if current temperature is hot enough
  259. * - Park the nozzle at the given position
  260. * - Call unload_filament (if a length was specified)
  261. *
  262. * Returns 'true' if pause was completed, 'false' for abort
  263. */
  264. uint8_t did_pause_print = 0;
  265. bool pause_print(const float &retract, const point_t &park_point, const float &unload_length/*=0*/, const bool show_lcd/*=false*/ DXC_ARGS) {
  266. if (did_pause_print) return false; // already paused
  267. #ifdef ACTION_ON_PAUSED
  268. host_action_paused();
  269. #elif defined(ACTION_ON_PAUSE)
  270. host_action_pause();
  271. #endif
  272. if (!DEBUGGING(DRYRUN) && unload_length && thermalManager.targetTooColdToExtrude(active_extruder)) {
  273. SERIAL_ECHO_MSG(MSG_ERR_HOTEND_TOO_COLD);
  274. #if HAS_LCD_MENU
  275. if (show_lcd) { // Show status screen
  276. lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS);
  277. LCD_MESSAGEPGM(MSG_M600_TOO_COLD);
  278. }
  279. #else
  280. UNUSED(show_lcd);
  281. #endif
  282. return false; // unable to reach safe temperature
  283. }
  284. // Indicate that the printer is paused
  285. ++did_pause_print;
  286. // Pause the print job and timer
  287. #if ENABLED(SDSUPPORT)
  288. if (IS_SD_PRINTING()) {
  289. card.pauseSDPrint();
  290. ++did_pause_print; // Indicate SD pause also
  291. }
  292. #endif
  293. print_job_timer.pause();
  294. // Save current position
  295. COPY(resume_position, current_position);
  296. // Wait for buffered blocks to complete
  297. planner.synchronize();
  298. // Initial retract before move to filament change position
  299. if (retract && thermalManager.hotEnoughToExtrude(active_extruder))
  300. do_pause_e_move(retract, PAUSE_PARK_RETRACT_FEEDRATE);
  301. // Park the nozzle by moving up by z_lift and then moving to (x_pos, y_pos)
  302. if (!axis_unhomed_error())
  303. Nozzle::park(2, park_point);
  304. #if ENABLED(DUAL_X_CARRIAGE)
  305. const int8_t saved_ext = active_extruder;
  306. const bool saved_ext_dup_mode = extruder_duplication_enabled;
  307. active_extruder = DXC_ext;
  308. extruder_duplication_enabled = false;
  309. #endif
  310. if (unload_length) // Unload the filament
  311. unload_filament(unload_length, show_lcd);
  312. #if ENABLED(DUAL_X_CARRIAGE)
  313. active_extruder = saved_ext;
  314. extruder_duplication_enabled = saved_ext_dup_mode;
  315. stepper.set_directions();
  316. #endif
  317. return true;
  318. }
  319. /**
  320. * For Paused Print:
  321. * - Show "Press button (or M108) to resume"
  322. *
  323. * For Filament Change:
  324. * - Show "Insert filament and press button to continue"
  325. *
  326. * - Wait for a click before returning
  327. * - Heaters can time out and must reheat before continuing
  328. *
  329. * Used by M125 and M600
  330. */
  331. #if (HAS_LCD_MENU || ENABLED(EXTENSIBLE_UI)) && ENABLED(EMERGENCY_PARSER)
  332. #define _PMSG(L) L
  333. #elif ENABLED(EMERGENCY_PARSER)
  334. #define _PMSG(L) L##_M108
  335. #else
  336. #define _PMSG(L) L##_LCD
  337. #endif
  338. void show_continue_prompt(const bool is_reload) {
  339. #if HAS_LCD_MENU
  340. lcd_advanced_pause_show_message(is_reload ? ADVANCED_PAUSE_MESSAGE_INSERT : ADVANCED_PAUSE_MESSAGE_WAITING);
  341. #endif
  342. SERIAL_ECHO_START();
  343. serialprintPGM(is_reload ? PSTR(_PMSG(MSG_FILAMENT_CHANGE_INSERT) "\n") : PSTR(_PMSG(MSG_FILAMENT_CHANGE_WAIT) "\n"));
  344. }
  345. void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep_count/*=0*/ DXC_ARGS) {
  346. bool nozzle_timed_out = false;
  347. show_continue_prompt(is_reload);
  348. #if HAS_BUZZER
  349. filament_change_beep(max_beep_count, true);
  350. #endif
  351. // Start the heater idle timers
  352. const millis_t nozzle_timeout = (millis_t)(PAUSE_PARK_NOZZLE_TIMEOUT) * 1000UL;
  353. HOTEND_LOOP()
  354. thermalManager.start_heater_idle_timer(e, nozzle_timeout);
  355. #if ENABLED(DUAL_X_CARRIAGE)
  356. const int8_t saved_ext = active_extruder;
  357. const bool saved_ext_dup_mode = extruder_duplication_enabled;
  358. active_extruder = DXC_ext;
  359. extruder_duplication_enabled = false;
  360. #endif
  361. // Wait for filament insert by user and press button
  362. KEEPALIVE_STATE(PAUSED_FOR_USER);
  363. wait_for_user = true; // LCD click or M108 will clear this
  364. while (wait_for_user) {
  365. #if HAS_BUZZER
  366. filament_change_beep(max_beep_count);
  367. #endif
  368. // If the nozzle has timed out...
  369. if (!nozzle_timed_out)
  370. HOTEND_LOOP() nozzle_timed_out |= thermalManager.is_heater_idle(e);
  371. // Wait for the user to press the button to re-heat the nozzle, then
  372. // re-heat the nozzle, re-show the continue prompt, restart idle timers, start over
  373. if (nozzle_timed_out) {
  374. #if HAS_LCD_MENU
  375. lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_HEAT);
  376. #endif
  377. SERIAL_ECHO_MSG(_PMSG(MSG_FILAMENT_CHANGE_HEAT));
  378. // Wait for LCD click or M108
  379. while (wait_for_user) idle(true);
  380. // Re-enable the heaters if they timed out
  381. HOTEND_LOOP() thermalManager.reset_heater_idle_timer(e);
  382. // Wait for the heaters to reach the target temperatures
  383. ensure_safe_temperature();
  384. // Show the prompt to continue
  385. show_continue_prompt(is_reload);
  386. // Start the heater idle timers
  387. const millis_t nozzle_timeout = (millis_t)(PAUSE_PARK_NOZZLE_TIMEOUT) * 1000UL;
  388. HOTEND_LOOP()
  389. thermalManager.start_heater_idle_timer(e, nozzle_timeout);
  390. wait_for_user = true;
  391. nozzle_timed_out = false;
  392. #if HAS_BUZZER
  393. filament_change_beep(max_beep_count, true);
  394. #endif
  395. }
  396. idle(true);
  397. }
  398. #if ENABLED(DUAL_X_CARRIAGE)
  399. active_extruder = saved_ext;
  400. extruder_duplication_enabled = saved_ext_dup_mode;
  401. stepper.set_directions();
  402. #endif
  403. KEEPALIVE_STATE(IN_HANDLER);
  404. }
  405. /**
  406. * Resume or Start print procedure
  407. *
  408. * - Abort if not paused
  409. * - Reset heater idle timers
  410. * - Load filament if specified, but only if:
  411. * - a nozzle timed out, or
  412. * - the nozzle is already heated.
  413. * - Display "wait for print to resume"
  414. * - Re-prime the nozzle...
  415. * - FWRETRACT: Recover/prime from the prior G10.
  416. * - !FWRETRACT: Retract by resume_position[E], if negative.
  417. * Not sure how this logic comes into use.
  418. * - Move the nozzle back to resume_position
  419. * - Sync the planner E to resume_position[E]
  420. * - Send host action for resume, if configured
  421. * - Resume the current SD print job, if any
  422. */
  423. void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_length/*=0*/, const float &purge_length/*=ADVANCED_PAUSE_PURGE_LENGTH*/, const int8_t max_beep_count/*=0*/ DXC_ARGS) {
  424. /*
  425. SERIAL_ECHOLNPGM("start of resume_print()");
  426. SERIAL_ECHOPAIR("\ndual_x_carriage_mode:", dual_x_carriage_mode);
  427. SERIAL_ECHOPAIR("\nextruder_duplication_enabled:", extruder_duplication_enabled);
  428. SERIAL_ECHOPAIR("\nactive_extruder:", active_extruder);
  429. SERIAL_ECHOLNPGM("\n");
  430. //*/
  431. if (!did_pause_print) return;
  432. // Re-enable the heaters if they timed out
  433. bool nozzle_timed_out = false;
  434. HOTEND_LOOP() {
  435. nozzle_timed_out |= thermalManager.is_heater_idle(e);
  436. thermalManager.reset_heater_idle_timer(e);
  437. }
  438. if (nozzle_timed_out || thermalManager.hotEnoughToExtrude(active_extruder)) // Load the new filament
  439. load_filament(slow_load_length, fast_load_length, purge_length, max_beep_count, true, nozzle_timed_out, ADVANCED_PAUSE_MODE_PAUSE_PRINT DXC_PASS);
  440. #if HAS_LCD_MENU
  441. lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_RESUME);
  442. #endif
  443. // Intelligent resuming
  444. #if ENABLED(FWRETRACT)
  445. // If retracted before goto pause
  446. if (fwretract.retracted[active_extruder])
  447. do_pause_e_move(-fwretract.settings.retract_length, fwretract.settings.retract_feedrate_mm_s);
  448. #endif
  449. // If resume_position is negative
  450. if (resume_position[E_AXIS] < 0) do_pause_e_move(resume_position[E_AXIS], PAUSE_PARK_RETRACT_FEEDRATE);
  451. // Move XY to starting position, then Z
  452. do_blocking_move_to_xy(resume_position[X_AXIS], resume_position[Y_AXIS], NOZZLE_PARK_XY_FEEDRATE);
  453. // Move Z_AXIS to saved position
  454. do_blocking_move_to_z(resume_position[Z_AXIS], NOZZLE_PARK_Z_FEEDRATE);
  455. // Now all extrusion positions are resumed and ready to be confirmed
  456. // Set extruder to saved position
  457. planner.set_e_position_mm((destination[E_AXIS] = current_position[E_AXIS] = resume_position[E_AXIS]));
  458. #if ENABLED(FILAMENT_RUNOUT_SENSOR)
  459. runout.reset();
  460. #endif
  461. #if HAS_LCD_MENU
  462. lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS);
  463. #endif
  464. #ifdef ACTION_ON_RESUMED
  465. host_action_resumed();
  466. #elif defined(ACTION_ON_RESUME)
  467. host_action_resume();
  468. #endif
  469. --did_pause_print;
  470. #if ENABLED(SDSUPPORT)
  471. if (did_pause_print) {
  472. card.startFileprint();
  473. --did_pause_print;
  474. }
  475. #endif
  476. // Resume the print job timer if it was running
  477. if (print_job_timer.isPaused()) print_job_timer.start();
  478. ui.reset_status();
  479. }
  480. #endif // ADVANCED_PAUSE_FEATURE