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.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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')) thermalManager.setTargetChamber(parser.value_celsius());
  46. }
  47. /**
  48. * M191: Sxxx Wait for chamber current temp to reach target temp. Waits only when heating
  49. * Rxxx Wait for chamber current temp to reach target temp. Waits when heating and cooling
  50. */
  51. void GcodeSuite::M191() {
  52. if (DEBUGGING(DRYRUN)) return;
  53. const bool no_wait_for_cooling = parser.seenval('S');
  54. if (no_wait_for_cooling || parser.seenval('R')) {
  55. thermalManager.setTargetChamber(parser.value_celsius());
  56. #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
  57. thermalManager.check_timer_autostart(true, false);
  58. #endif
  59. }
  60. else return;
  61. const bool is_heating = thermalManager.isHeatingChamber();
  62. if (is_heating || !no_wait_for_cooling) {
  63. ui.set_status_P(is_heating ? GET_TEXT(MSG_CHAMBER_HEATING) : GET_TEXT(MSG_CHAMBER_COOLING));
  64. thermalManager.wait_for_chamber(false);
  65. }
  66. }
  67. #endif // HAS_HEATED_CHAMBER