My Marlin configs for Fabrikator Mini and CTC i3 Pro B
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

M141_M191.cpp 2.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 <http://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 "../../module/motion.h"
  32. #include "../../lcd/ultralcd.h"
  33. #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
  34. #include "../../module/printcounter.h"
  35. #endif
  36. #if ENABLED(PRINTER_EVENT_LEDS)
  37. #include "../../feature/leds/leds.h"
  38. #endif
  39. #include "../../MarlinCore.h" // for wait_for_heatup, idle, startOrResumeJob
  40. /**
  41. * M141: Set chamber temperature
  42. */
  43. void GcodeSuite::M141() {
  44. if (DEBUGGING(DRYRUN)) return;
  45. if (parser.seenval('S')) {
  46. thermalManager.setTargetChamber(parser.value_celsius());
  47. #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
  48. /**
  49. * Stop the timer at the end of print. Hotend, bed target, and chamber
  50. * temperatures need to be set below mintemp. Order of M140, M104, and M141
  51. * at the end of the print does not matter.
  52. */
  53. thermalManager.check_timer_autostart(false, true);
  54. #endif
  55. }
  56. }
  57. /**
  58. * M191: Sxxx Wait for chamber current temp to reach target temp. Waits only when heating
  59. * Rxxx Wait for chamber current temp to reach target temp. Waits when heating and cooling
  60. */
  61. void GcodeSuite::M191() {
  62. if (DEBUGGING(DRYRUN)) return;
  63. const bool no_wait_for_cooling = parser.seenval('S');
  64. if (no_wait_for_cooling || parser.seenval('R')) {
  65. thermalManager.setTargetChamber(parser.value_celsius());
  66. TERN_(PRINTJOB_TIMER_AUTOSTART, thermalManager.check_timer_autostart(true, false));
  67. }
  68. else return;
  69. const bool is_heating = thermalManager.isHeatingChamber();
  70. if (is_heating || !no_wait_for_cooling) {
  71. ui.set_status_P(is_heating ? GET_TEXT(MSG_CHAMBER_HEATING) : GET_TEXT(MSG_CHAMBER_COOLING));
  72. thermalManager.wait_for_chamber(false);
  73. }
  74. }
  75. #endif // HAS_HEATED_CHAMBER