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.

M141_M191.cpp 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. /**
  23. * gcode/temp/M141_M191.cpp
  24. *
  25. * Chamber target temperature control
  26. */
  27. #include "../../inc/MarlinConfig.h"
  28. #if HAS_HEATED_CHAMBER
  29. #include "../gcode.h"
  30. #include "../../module/temperature.h"
  31. #include "../../lcd/marlinui.h"
  32. /**
  33. * M141: Set chamber temperature
  34. */
  35. void GcodeSuite::M141() {
  36. if (DEBUGGING(DRYRUN)) return;
  37. if (parser.seenval('S')) {
  38. thermalManager.setTargetChamber(parser.value_celsius());
  39. #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
  40. /**
  41. * Stop the timer at the end of print. Hotend, bed target, and chamber
  42. * temperatures need to be set below mintemp. Order of M140, M104, and M141
  43. * at the end of the print does not matter.
  44. */
  45. thermalManager.auto_job_check_timer(false, true);
  46. #endif
  47. }
  48. }
  49. /**
  50. * M191: Sxxx Wait for chamber current temp to reach target temp. Waits only when heating
  51. * Rxxx Wait for chamber current temp to reach target temp. Waits when heating and cooling
  52. */
  53. void GcodeSuite::M191() {
  54. if (DEBUGGING(DRYRUN)) return;
  55. const bool no_wait_for_cooling = parser.seenval('S');
  56. if (no_wait_for_cooling || parser.seenval('R')) {
  57. thermalManager.setTargetChamber(parser.value_celsius());
  58. TERN_(PRINTJOB_TIMER_AUTOSTART, thermalManager.auto_job_check_timer(true, false));
  59. }
  60. else return;
  61. const bool is_heating = thermalManager.isHeatingChamber();
  62. if (is_heating || !no_wait_for_cooling) {
  63. ui.set_status(is_heating ? GET_TEXT_F(MSG_CHAMBER_HEATING) : GET_TEXT_F(MSG_CHAMBER_COOLING));
  64. thermalManager.wait_for_chamber(false);
  65. }
  66. }
  67. #endif // HAS_HEATED_CHAMBER