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.

Marlin Logo.svg 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2019 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. // Filament Change Menu
  24. //
  25. #include "../../inc/MarlinConfigPre.h"
  26. #if HAS_LCD_MENU && ENABLED(ADVANCED_PAUSE_FEATURE)
  27. #include "menu.h"
  28. #include "../../module/temperature.h"
  29. #include "../../feature/pause.h"
  30. #if HAS_FILAMENT_SENSOR
  31. #include "../../feature/runout.h"
  32. #endif
  33. //
  34. // Change Filament > Change/Unload/Load Filament
  35. //
  36. static PauseMode _change_filament_temp_mode; // =PAUSE_MODE_PAUSE_PRINT
  37. static int8_t _change_filament_temp_extruder; // =0
  38. inline PGM_P _change_filament_temp_command() {
  39. switch (_change_filament_temp_mode) {
  40. case PAUSE_MODE_LOAD_FILAMENT:
  41. return PSTR("M701 T%d");
  42. case PAUSE_MODE_UNLOAD_FILAMENT:
  43. return _change_filament_temp_extruder >= 0 ? PSTR("M702 T%d") : PSTR("M702 ;%d");
  44. case PAUSE_MODE_PAUSE_PRINT:
  45. default:
  46. return PSTR("M600 B0 T%d");
  47. }
  48. return PSTR(MSG_FILAMENTCHANGE);
  49. }
  50. static void _change_filament_temp(const uint16_t temperature) {
  51. char cmd[11];
  52. sprintf_P(cmd, _change_filament_temp_command(), _change_filament_temp_extruder);
  53. thermalManager.setTargetHotend(temperature, _change_filament_temp_extruder);
  54. lcd_enqueue_one_now(cmd);
  55. }
  56. inline void _lcd_change_filament_temp_1_func() { _change_filament_temp(ui.preheat_hotend_temp[0]); }
  57. inline void _lcd_change_filament_temp_2_func() { _change_filament_temp(ui.preheat_hotend_temp[1]); }
  58. inline void _lcd_change_filament_temp_custom_cb() { _change_filament_temp(thermalManager.temp_hotend[_change_filament_temp_extruder].target); }
  59. static PGM_P change_filament_header(const PauseMode mode) {
  60. switch (mode) {
  61. case PAUSE_MODE_LOAD_FILAMENT:
  62. return PSTR(MSG_FILAMENTLOAD);
  63. case PAUSE_MODE_UNLOAD_FILAMENT:
  64. return PSTR(MSG_FILAMENTUNLOAD);
  65. default: break;
  66. }
  67. return PSTR(MSG_FILAMENTCHANGE);
  68. }
  69. void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) {
  70. _change_filament_temp_mode = mode;
  71. _change_filament_temp_extruder = extruder;
  72. START_MENU();
  73. if (LCD_HEIGHT >= 4) STATIC_ITEM_P(change_filament_header(mode), true, true);
  74. MENU_BACK(MSG_BACK);
  75. MENU_ITEM(function, MSG_PREHEAT_1, _lcd_change_filament_temp_1_func);
  76. MENU_ITEM(function, MSG_PREHEAT_2, _lcd_change_filament_temp_2_func);
  77. uint16_t max_temp;
  78. switch (extruder) {
  79. default: max_temp = HEATER_0_MAXTEMP;
  80. #if HOTENDS > 1
  81. case 1: max_temp = HEATER_1_MAXTEMP; break;
  82. #if HOTENDS > 2
  83. case 2: max_temp = HEATER_2_MAXTEMP; break;
  84. #if HOTENDS > 3
  85. case 3: max_temp = HEATER_3_MAXTEMP; break;
  86. #if HOTENDS > 4
  87. case 4: max_temp = HEATER_4_MAXTEMP; break;
  88. #if HOTENDS > 5
  89. case 5: max_temp = HEATER_5_MAXTEMP; break;
  90. #endif
  91. #endif
  92. #endif
  93. #endif
  94. #endif
  95. }
  96. MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_PREHEAT_CUSTOM, &thermalManager.temp_hotend[_change_filament_temp_extruder].target, EXTRUDE_MINTEMP, max_temp - 15, _lcd_change_filament_temp_custom_cb);
  97. END_MENU();
  98. }
  99. #if E_STEPPERS
  100. void menu_temp_e0_filament_change() { _menu_temp_filament_op(PAUSE_MODE_PAUSE_PRINT, 0); }
  101. void menu_temp_e0_filament_load() { _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, 0); }
  102. void menu_temp_e0_filament_unload() { _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, 0); }
  103. #if E_STEPPERS > 1
  104. void menu_temp_e1_filament_change() { _menu_temp_filament_op(PAUSE_MODE_PAUSE_PRINT, 1); }
  105. void menu_temp_e1_filament_load() { _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, 1); }
  106. void menu_temp_e1_filament_unload() { _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, 1); }
  107. #if ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS)
  108. void menu_unload_filament_all_temp() { _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, -1); }
  109. #endif
  110. #if E_STEPPERS > 2
  111. void menu_temp_e2_filament_change() { _menu_temp_filament_op(PAUSE_MODE_PAUSE_PRINT, 2); }
  112. void menu_temp_e2_filament_load() { _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, 2); }
  113. void menu_temp_e2_filament_unload() { _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, 2); }
  114. #if E_STEPPERS > 3
  115. void menu_temp_e3_filament_change() { _menu_temp_filament_op(PAUSE_MODE_PAUSE_PRINT, 3); }
  116. void menu_temp_e3_filament_load() { _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, 3); }
  117. void menu_temp_e3_filament_unload() { _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, 3); }
  118. #if E_STEPPERS > 4
  119. void menu_temp_e4_filament_change() { _menu_temp_filament_op(PAUSE_MODE_PAUSE_PRINT, 4); }
  120. void menu_temp_e4_filament_load() { _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, 4); }
  121. void menu_temp_e4_filament_unload() { _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, 4); }
  122. #endif // E_STEPPERS > 4
  123. #endif // E_STEPPERS > 3
  124. #endif // E_STEPPERS > 2
  125. #endif // E_STEPPERS > 1
  126. #endif // E_STEPPERS
  127. /**
  128. *
  129. * "Change Filament" submenu
  130. *
  131. */
  132. #if E_STEPPERS > 1 || ENABLED(FILAMENT_LOAD_UNLOAD_GCODES)
  133. void menu_change_filament() {
  134. START_MENU();
  135. MENU_BACK(MSG_MAIN);
  136. // Change filament
  137. #if E_STEPPERS == 1
  138. PGM_P msg0 = PSTR(MSG_FILAMENTCHANGE);
  139. if (thermalManager.targetTooColdToExtrude(active_extruder))
  140. MENU_ITEM_P(submenu, msg0, menu_temp_e0_filament_change);
  141. else
  142. MENU_ITEM_P(gcode, msg0, PSTR("M600 B0"));
  143. #else
  144. PGM_P msg0 = PSTR(MSG_FILAMENTCHANGE " " MSG_E1);
  145. PGM_P msg1 = PSTR(MSG_FILAMENTCHANGE " " MSG_E2);
  146. if (thermalManager.targetTooColdToExtrude(0))
  147. MENU_ITEM_P(submenu, msg0, menu_temp_e0_filament_change);
  148. else
  149. MENU_ITEM_P(gcode, msg0, PSTR("M600 B0 T0"));
  150. if (thermalManager.targetTooColdToExtrude(1))
  151. MENU_ITEM_P(submenu, msg1, menu_temp_e1_filament_change);
  152. else
  153. MENU_ITEM_P(gcode, msg1, PSTR("M600 B0 T1"));
  154. #if E_STEPPERS > 2
  155. PGM_P msg2 = PSTR(MSG_FILAMENTCHANGE " " MSG_E3);
  156. if (thermalManager.targetTooColdToExtrude(2))
  157. MENU_ITEM_P(submenu, msg2, menu_temp_e2_filament_change);
  158. else
  159. MENU_ITEM_P(gcode, msg2, PSTR("M600 B0 T2"));
  160. #if E_STEPPERS > 3
  161. PGM_P msg3 = PSTR(MSG_FILAMENTCHANGE " " MSG_E4);
  162. if (thermalManager.targetTooColdToExtrude(3))
  163. MENU_ITEM_P(submenu, msg3, menu_temp_e3_filament_change);
  164. else
  165. MENU_ITEM_P(gcode, msg3, PSTR("M600 B0 T3"));
  166. #if E_STEPPERS > 4
  167. PGM_P msg4 = PSTR(MSG_FILAMENTCHANGE " " MSG_E5);
  168. if (thermalManager.targetTooColdToExtrude(4))
  169. MENU_ITEM_P(submenu, msg4, menu_temp_e4_filament_change);
  170. else
  171. MENU_ITEM_P(gcode, msg4, PSTR("M600 B0 T4"));
  172. #if E_STEPPERS > 5
  173. PGM_P msg5 = PSTR(MSG_FILAMENTCHANGE " " MSG_E6);
  174. if (thermalManager.targetTooColdToExtrude(5))
  175. MENU_ITEM_P(submenu, msg5, menu_temp_e5_filament_change);
  176. else
  177. MENU_ITEM_P(gcode, msg5, PSTR("M600 B0 T5"));
  178. #endif // E_STEPPERS > 5
  179. #endif // E_STEPPERS > 4
  180. #endif // E_STEPPERS > 3
  181. #endif // E_STEPPERS > 2
  182. #endif // E_STEPPERS == 1
  183. #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES)
  184. if (!printer_busy()) {
  185. // Load filament
  186. #if E_STEPPERS == 1
  187. PGM_P msg0 = PSTR(MSG_FILAMENTLOAD);
  188. if (thermalManager.targetTooColdToExtrude(active_extruder))
  189. MENU_ITEM_P(submenu, msg0, menu_temp_e0_filament_load);
  190. else
  191. MENU_ITEM_P(gcode, msg0, PSTR("M701"));
  192. #else
  193. PGM_P msg0 = PSTR(MSG_FILAMENTLOAD " " MSG_E1);
  194. PGM_P msg1 = PSTR(MSG_FILAMENTLOAD " " MSG_E2);
  195. if (thermalManager.targetTooColdToExtrude(0))
  196. MENU_ITEM_P(submenu, msg0, menu_temp_e0_filament_load);
  197. else
  198. MENU_ITEM_P(gcode, msg0, PSTR("M701 T0"));
  199. if (thermalManager.targetTooColdToExtrude(1))
  200. MENU_ITEM_P(submenu, msg1, menu_temp_e1_filament_load);
  201. else
  202. MENU_ITEM_P(gcode, msg1, PSTR("M701 T1"));
  203. #if E_STEPPERS > 2
  204. PGM_P msg2 = PSTR(MSG_FILAMENTLOAD " " MSG_E3);
  205. if (thermalManager.targetTooColdToExtrude(2))
  206. MENU_ITEM_P(submenu, msg2, menu_temp_e2_filament_load);
  207. else
  208. MENU_ITEM_P(gcode, msg2, PSTR("M701 T2"));
  209. #if E_STEPPERS > 3
  210. PGM_P msg3 = PSTR(MSG_FILAMENTLOAD " " MSG_E4);
  211. if (thermalManager.targetTooColdToExtrude(3))
  212. MENU_ITEM_P(submenu, msg3, menu_temp_e3_filament_load);
  213. else
  214. MENU_ITEM_P(gcode, msg3, PSTR("M701 T3"));
  215. #if E_STEPPERS > 4
  216. PGM_P msg4 = PSTR(MSG_FILAMENTLOAD " " MSG_E5);
  217. if (thermalManager.targetTooColdToExtrude(4))
  218. MENU_ITEM_P(submenu, msg4, menu_temp_e4_filament_load);
  219. else
  220. MENU_ITEM_P(gcode, msg4, PSTR("M701 T4"));
  221. #if E_STEPPERS > 5
  222. PGM_P msg5 = PSTR(MSG_FILAMENTLOAD " " MSG_E6);
  223. if (thermalManager.targetTooColdToExtrude(5))
  224. MENU_ITEM_P(submenu, msg5, menu_temp_e5_filament_load);
  225. else
  226. MENU_ITEM_P(gcode, msg5, PSTR("M701 T5"));
  227. #endif // E_STEPPERS > 5
  228. #endif // E_STEPPERS > 4
  229. #endif // E_STEPPERS > 3
  230. #endif // E_STEPPERS > 2
  231. #endif // E_STEPPERS == 1
  232. // Unload filament
  233. #if E_STEPPERS == 1
  234. if (thermalManager.targetHotEnoughToExtrude(active_extruder))
  235. MENU_ITEM(gcode, MSG_FILAMENTUNLOAD, PSTR("M702"));
  236. else
  237. MENU_ITEM(submenu, MSG_FILAMENTUNLOAD, menu_temp_e0_filament_unload);
  238. #else
  239. #if ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS)
  240. if (thermalManager.targetHotEnoughToExtrude(0)
  241. #if E_STEPPERS > 1
  242. && thermalManager.targetHotEnoughToExtrude(1)
  243. #if E_STEPPERS > 2
  244. && thermalManager.targetHotEnoughToExtrude(2)
  245. #if E_STEPPERS > 3
  246. && thermalManager.targetHotEnoughToExtrude(3)
  247. #if E_STEPPERS > 4
  248. && thermalManager.targetHotEnoughToExtrude(4)
  249. #if E_STEPPERS > 5
  250. && thermalManager.targetHotEnoughToExtrude(5)
  251. #endif // E_STEPPERS > 5
  252. #endif // E_STEPPERS > 4
  253. #endif // E_STEPPERS > 3
  254. #endif // E_STEPPERS > 2
  255. #endif // E_STEPPERS > 1
  256. )
  257. MENU_ITEM(gcode, MSG_FILAMENTUNLOAD_ALL, PSTR("M702"));
  258. else
  259. MENU_ITEM(submenu, MSG_FILAMENTUNLOAD_ALL, menu_unload_filament_all_temp);
  260. #endif
  261. if (thermalManager.targetHotEnoughToExtrude(0))
  262. MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E1, PSTR("M702 T0"));
  263. else
  264. MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E1, menu_temp_e0_filament_unload);
  265. if (thermalManager.targetHotEnoughToExtrude(1))
  266. MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E2, PSTR("M702 T1"));
  267. else
  268. MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E2, menu_temp_e1_filament_unload);
  269. #if E_STEPPERS > 2
  270. if (thermalManager.targetHotEnoughToExtrude(2))
  271. MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E3, PSTR("M702 T2"));
  272. else
  273. MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E3, menu_temp_e2_filament_unload);
  274. #if E_STEPPERS > 3
  275. if (thermalManager.targetHotEnoughToExtrude(3))
  276. MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E4, PSTR("M702 T3"));
  277. else
  278. MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E4, menu_temp_e3_filament_unload);
  279. #if E_STEPPERS > 4
  280. if (thermalManager.targetHotEnoughToExtrude(4))
  281. MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E5, PSTR("M702 T4"));
  282. else
  283. MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E5, menu_temp_e4_filament_unload);
  284. #if E_STEPPERS > 5
  285. if (thermalManager.targetHotEnoughToExtrude(5))
  286. MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E6, PSTR("M702 T5"));
  287. else
  288. MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E6, menu_temp_e5_filament_unload);
  289. #endif // E_STEPPERS > 5
  290. #endif // E_STEPPERS > 4
  291. #endif // E_STEPPERS > 3
  292. #endif // E_STEPPERS > 2
  293. #endif // E_STEPPERS == 1
  294. }
  295. #endif
  296. END_MENU();
  297. }
  298. #endif
  299. static uint8_t hotend_status_extruder = 0;
  300. static PGM_P pause_header() {
  301. switch (pause_mode) {
  302. case PAUSE_MODE_LOAD_FILAMENT:
  303. return PSTR(MSG_FILAMENT_CHANGE_HEADER_LOAD);
  304. case PAUSE_MODE_UNLOAD_FILAMENT:
  305. return PSTR(MSG_FILAMENT_CHANGE_HEADER_UNLOAD);
  306. default: break;
  307. }
  308. return PSTR(MSG_FILAMENT_CHANGE_HEADER_PAUSE);
  309. }
  310. // Portions from STATIC_ITEM...
  311. #define HOTEND_STATUS_ITEM() do { \
  312. if (_menuLineNr == _thisItemNr) { \
  313. if (ui.should_draw()) { \
  314. draw_menu_item_static(_lcdLineNr, PSTR(MSG_FILAMENT_CHANGE_NOZZLE), false, true); \
  315. ui.draw_hotend_status(_lcdLineNr, hotend_status_extruder); \
  316. } \
  317. if (_skipStatic && encoderLine <= _thisItemNr) { \
  318. ui.encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \
  319. ++encoderLine; \
  320. } \
  321. ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); \
  322. } \
  323. ++_thisItemNr; \
  324. }while(0)
  325. void lcd_pause_resume_print() {
  326. pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT;
  327. }
  328. void lcd_pause_extrude_more() {
  329. pause_menu_response = PAUSE_RESPONSE_EXTRUDE_MORE;
  330. }
  331. void menu_pause_option() {
  332. START_MENU();
  333. #if LCD_HEIGHT > 2
  334. STATIC_ITEM(MSG_FILAMENT_CHANGE_OPTION_HEADER, true, false);
  335. #endif
  336. MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_PURGE, lcd_pause_extrude_more);
  337. #if HAS_FILAMENT_SENSOR
  338. if (runout.filament_ran_out)
  339. MENU_ITEM_EDIT_CALLBACK(bool, MSG_RUNOUT_SENSOR, &runout.enabled, runout.reset);
  340. else
  341. #endif
  342. MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_RESUME, lcd_pause_resume_print);
  343. END_MENU();
  344. }
  345. //
  346. // ADVANCED_PAUSE_FEATURE message screens
  347. //
  348. void _lcd_pause_message(PGM_P const msg1, PGM_P const msg2=nullptr, PGM_P const msg3=nullptr) {
  349. START_SCREEN();
  350. STATIC_ITEM_P(pause_header(), true, true);
  351. STATIC_ITEM_P(msg1);
  352. if (msg2) STATIC_ITEM_P(msg2);
  353. if (msg3 && (LCD_HEIGHT) >= 5) STATIC_ITEM_P(msg3);
  354. if ((!!msg2) + (!!msg3) + 2 < (LCD_HEIGHT) - 1) STATIC_ITEM(" ");
  355. HOTEND_STATUS_ITEM();
  356. END_SCREEN();
  357. }
  358. void lcd_pause_pausing_message() {
  359. _lcd_pause_message(PSTR(MSG_PAUSE_PRINT_INIT_1)
  360. #ifdef MSG_PAUSE_PRINT_INIT_2
  361. , PSTR(MSG_PAUSE_PRINT_INIT_2)
  362. #ifdef MSG_PAUSE_PRINT_INIT_3
  363. , PSTR(MSG_PAUSE_PRINT_INIT_3)
  364. #endif
  365. #endif
  366. );
  367. }
  368. void lcd_pause_changing_message() {
  369. _lcd_pause_message(PSTR(MSG_FILAMENT_CHANGE_INIT_1)
  370. #ifdef MSG_FILAMENT_CHANGE_INIT_2
  371. , PSTR(MSG_FILAMENT_CHANGE_INIT_2)
  372. #ifdef MSG_FILAMENT_CHANGE_INIT_3
  373. , PSTR(MSG_FILAMENT_CHANGE_INIT_3)
  374. #endif
  375. #endif
  376. );
  377. }
  378. void lcd_pause_unload_message() {
  379. _lcd_pause_message(PSTR(MSG_FILAMENT_CHANGE_UNLOAD_1)
  380. #ifdef MSG_FILAMENT_CHANGE_UNLOAD_2
  381. , PSTR(MSG_FILAMENT_CHANGE_UNLOAD_2)
  382. #ifdef MSG_FILAMENT_CHANGE_UNLOAD_3
  383. , PSTR(MSG_FILAMENT_CHANGE_UNLOAD_3)
  384. #endif
  385. #endif
  386. );
  387. }
  388. void lcd_pause_heating_message() {
  389. _lcd_pause_message(PSTR(MSG_FILAMENT_CHANGE_HEATING_1)
  390. #ifdef MSG_FILAMENT_CHANGE_HEATING_2
  391. , PSTR(MSG_FILAMENT_CHANGE_HEATING_2)
  392. #ifdef MSG_FILAMENT_CHANGE_HEATING_3
  393. , PSTR(MSG_FILAMENT_CHANGE_HEATING_3)
  394. #endif
  395. #endif
  396. );
  397. }
  398. void lcd_pause_heat_message() {
  399. _lcd_pause_message(PSTR(MSG_FILAMENT_CHANGE_HEAT_1)
  400. #ifdef MSG_FILAMENT_CHANGE_HEAT_2
  401. , PSTR(MSG_FILAMENT_CHANGE_HEAT_2)
  402. #ifdef MSG_FILAMENT_CHANGE_HEAT_3
  403. , PSTR(MSG_FILAMENT_CHANGE_HEAT_3)
  404. #endif
  405. #endif
  406. );
  407. }
  408. void lcd_pause_insert_message() {
  409. _lcd_pause_message(PSTR(MSG_FILAMENT_CHANGE_INSERT_1)
  410. #ifdef MSG_FILAMENT_CHANGE_INSERT_2
  411. , PSTR(MSG_FILAMENT_CHANGE_INSERT_2)
  412. #ifdef MSG_FILAMENT_CHANGE_INSERT_3
  413. , PSTR(MSG_FILAMENT_CHANGE_INSERT_3)
  414. #endif
  415. #endif
  416. );
  417. }
  418. void lcd_pause_load_message() {
  419. _lcd_pause_message(PSTR(MSG_FILAMENT_CHANGE_LOAD_1)
  420. #ifdef MSG_FILAMENT_CHANGE_LOAD_2
  421. , PSTR(MSG_FILAMENT_CHANGE_LOAD_2)
  422. #ifdef MSG_FILAMENT_CHANGE_LOAD_3
  423. , PSTR(MSG_FILAMENT_CHANGE_LOAD_3)
  424. #endif
  425. #endif
  426. );
  427. }
  428. void lcd_pause_waiting_message() {
  429. _lcd_pause_message(PSTR(MSG_ADVANCED_PAUSE_WAITING_1)
  430. #ifdef MSG_ADVANCED_PAUSE_WAITING_2
  431. , PSTR(MSG_ADVANCED_PAUSE_WAITING_2)
  432. #ifdef MSG_ADVANCED_PAUSE_WAITING_3
  433. , PSTR(MSG_ADVANCED_PAUSE_WAITING_3)
  434. #endif
  435. #endif
  436. );
  437. }
  438. void lcd_pause_resume_message() {
  439. _lcd_pause_message(PSTR(MSG_FILAMENT_CHANGE_RESUME_1)
  440. #ifdef MSG_FILAMENT_CHANGE_RESUME_2
  441. , PSTR(MSG_FILAMENT_CHANGE_RESUME_2)
  442. #ifdef MSG_FILAMENT_CHANGE_RESUME_3
  443. , PSTR(MSG_FILAMENT_CHANGE_RESUME_3)
  444. #endif
  445. #endif
  446. );
  447. }
  448. void lcd_pause_purge_message() {
  449. _lcd_pause_message(
  450. #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE)
  451. PSTR(MSG_FILAMENT_CHANGE_CONT_PURGE_1)
  452. #ifdef MSG_FILAMENT_CHANGE_CONT_PURGE_2
  453. , PSTR(MSG_FILAMENT_CHANGE_CONT_PURGE_2)
  454. #ifdef MSG_FILAMENT_CHANGE_CONT_PURGE_3
  455. , PSTR(MSG_FILAMENT_CHANGE_CONT_PURGE_3)
  456. #endif
  457. #endif
  458. #else
  459. PSTR(MSG_FILAMENT_CHANGE_PURGE_1)
  460. #ifdef MSG_FILAMENT_CHANGE_PURGE_2
  461. , PSTR(MSG_FILAMENT_CHANGE_PURGE_2)
  462. #ifdef MSG_FILAMENT_CHANGE_PURGE_3
  463. , PSTR(MSG_FILAMENT_CHANGE_PURGE_3)
  464. #endif
  465. #endif
  466. #endif
  467. );
  468. }
  469. FORCE_INLINE screenFunc_t ap_message_screen(const PauseMessage message) {
  470. switch (message) {
  471. case PAUSE_MESSAGE_PAUSING: return lcd_pause_pausing_message;
  472. case PAUSE_MESSAGE_CHANGING: return lcd_pause_changing_message;
  473. case PAUSE_MESSAGE_UNLOAD: return lcd_pause_unload_message;
  474. case PAUSE_MESSAGE_WAITING: return lcd_pause_waiting_message;
  475. case PAUSE_MESSAGE_INSERT: return lcd_pause_insert_message;
  476. case PAUSE_MESSAGE_LOAD: return lcd_pause_load_message;
  477. case PAUSE_MESSAGE_PURGE: return lcd_pause_purge_message;
  478. case PAUSE_MESSAGE_RESUME: return lcd_pause_resume_message;
  479. case PAUSE_MESSAGE_HEAT: return lcd_pause_heat_message;
  480. case PAUSE_MESSAGE_HEATING: return lcd_pause_heating_message;
  481. case PAUSE_MESSAGE_OPTION: pause_menu_response = PAUSE_RESPONSE_WAIT_FOR;
  482. return menu_pause_option;
  483. case PAUSE_MESSAGE_STATUS:
  484. default: break;
  485. }
  486. return nullptr;
  487. }
  488. void lcd_pause_show_message(
  489. const PauseMessage message,
  490. const PauseMode mode/*=PAUSE_MODE_SAME*/,
  491. const uint8_t extruder/*=active_extruder*/
  492. ) {
  493. if (mode != PAUSE_MODE_SAME) pause_mode = mode;
  494. hotend_status_extruder = extruder;
  495. const screenFunc_t next_screen = ap_message_screen(message);
  496. if (next_screen) {
  497. ui.defer_status_screen();
  498. ui.goto_screen(next_screen);
  499. }
  500. else
  501. ui.return_to_status();
  502. }
  503. #endif // HAS_LCD_MENU && ADVANCED_PAUSE_FEATURE