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.h 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2020 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 <https://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #pragma once
  23. /**
  24. * feature/pause.h - Pause feature support functions
  25. * This may be combined with related G-codes if features are consolidated.
  26. */
  27. typedef struct {
  28. float unload_length, load_length;
  29. } fil_change_settings_t;
  30. #include "../inc/MarlinConfigPre.h"
  31. #if ENABLED(ADVANCED_PAUSE_FEATURE)
  32. #include "../libs/nozzle.h"
  33. enum PauseMode : char {
  34. PAUSE_MODE_SAME,
  35. PAUSE_MODE_PAUSE_PRINT,
  36. PAUSE_MODE_CHANGE_FILAMENT,
  37. PAUSE_MODE_LOAD_FILAMENT,
  38. PAUSE_MODE_UNLOAD_FILAMENT
  39. };
  40. enum PauseMessage : char {
  41. PAUSE_MESSAGE_PARKING,
  42. PAUSE_MESSAGE_CHANGING,
  43. PAUSE_MESSAGE_WAITING,
  44. PAUSE_MESSAGE_UNLOAD,
  45. PAUSE_MESSAGE_INSERT,
  46. PAUSE_MESSAGE_LOAD,
  47. PAUSE_MESSAGE_PURGE,
  48. PAUSE_MESSAGE_OPTION,
  49. PAUSE_MESSAGE_RESUME,
  50. PAUSE_MESSAGE_STATUS,
  51. PAUSE_MESSAGE_HEAT,
  52. PAUSE_MESSAGE_HEATING
  53. };
  54. #if M600_PURGE_MORE_RESUMABLE
  55. enum PauseMenuResponse : char {
  56. PAUSE_RESPONSE_WAIT_FOR,
  57. PAUSE_RESPONSE_EXTRUDE_MORE,
  58. PAUSE_RESPONSE_RESUME_PRINT
  59. };
  60. extern PauseMenuResponse pause_menu_response;
  61. extern PauseMode pause_mode;
  62. #endif
  63. extern fil_change_settings_t fc_settings[EXTRUDERS];
  64. extern uint8_t did_pause_print;
  65. #define DXC_PARAMS OPTARG(DUAL_X_CARRIAGE, const int8_t DXC_ext=-1)
  66. #define DXC_ARGS OPTARG(DUAL_X_CARRIAGE, const int8_t DXC_ext)
  67. #define DXC_PASS OPTARG(DUAL_X_CARRIAGE, DXC_ext)
  68. #define DXC_SAY OPTARG(DUAL_X_CARRIAGE, " dxc:", int(DXC_ext))
  69. // Pause the print. If unload_length is set, do a Filament Unload
  70. bool pause_print(
  71. const_float_t retract, // (mm) Retraction length
  72. const xyz_pos_t &park_point, // Parking XY Position and Z Raise
  73. const bool show_lcd=false, // Set LCD status messages?
  74. const_float_t unload_length=0 // (mm) Filament Change Unload Length - 0 to skip
  75. DXC_PARAMS // Dual-X-Carriage extruder index
  76. );
  77. void wait_for_confirmation(
  78. const bool is_reload=false, // Reload Filament? (otherwise Resume Print)
  79. const int8_t max_beep_count=0 // Beep alert for attention
  80. DXC_PARAMS // Dual-X-Carriage extruder index
  81. );
  82. void resume_print(
  83. const_float_t slow_load_length=0, // (mm) Slow Load Length for finishing move
  84. const_float_t fast_load_length=0, // (mm) Fast Load Length for initial move
  85. const_float_t extrude_length=ADVANCED_PAUSE_PURGE_LENGTH, // (mm) Purge length
  86. const int8_t max_beep_count=0, // Beep alert for attention
  87. const celsius_t targetTemp=0 // (°C) A target temperature for the hotend
  88. DXC_PARAMS // Dual-X-Carriage extruder index
  89. );
  90. bool load_filament(
  91. const_float_t slow_load_length=0, // (mm) Slow Load Length for finishing move
  92. const_float_t fast_load_length=0, // (mm) Fast Load Length for initial move
  93. const_float_t extrude_length=0, // (mm) Purge length
  94. const int8_t max_beep_count=0, // Beep alert for attention
  95. const bool show_lcd=false, // Set LCD status messages?
  96. const bool pause_for_user=false, // Pause for user before returning?
  97. const PauseMode mode=PAUSE_MODE_PAUSE_PRINT // Pause Mode to apply
  98. DXC_PARAMS // Dual-X-Carriage extruder index
  99. );
  100. bool unload_filament(
  101. const_float_t unload_length, // (mm) Filament Unload Length - 0 to skip
  102. const bool show_lcd=false, // Set LCD status messages?
  103. const PauseMode mode=PAUSE_MODE_PAUSE_PRINT // Pause Mode to apply
  104. #if BOTH(FILAMENT_UNLOAD_ALL_EXTRUDERS, MIXING_EXTRUDER)
  105. , const_float_t mix_multiplier=1.0f // Extrusion multiplier (for a Mixing Extruder)
  106. #endif
  107. );
  108. #else // !ADVANCED_PAUSE_FEATURE
  109. constexpr uint8_t did_pause_print = 0;
  110. #endif // !ADVANCED_PAUSE_FEATURE