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.

M17_M18_M84.cpp 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (C) 2016 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. #include "../gcode.h"
  23. #include "../../Marlin.h" // for stepper_inactive_time
  24. #include "../../lcd/ultralcd.h"
  25. #include "../../module/stepper.h"
  26. #if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTRA_LCD)
  27. #include "../../feature/bedlevel/bedlevel.h"
  28. #endif
  29. /**
  30. * M17: Enable power on all stepper motors
  31. */
  32. void GcodeSuite::M17() {
  33. LCD_MESSAGEPGM(MSG_NO_MOVE);
  34. enable_all_steppers();
  35. }
  36. /**
  37. * M18, M84: Disable stepper motors
  38. */
  39. void GcodeSuite::M18_M84() {
  40. if (parser.seenval('S')) {
  41. stepper_inactive_time = parser.value_millis_from_seconds();
  42. }
  43. else {
  44. bool all_axis = !(parser.seen('X') || parser.seen('Y') || parser.seen('Z') || parser.seen('E'));
  45. if (all_axis) {
  46. planner.finish_and_disable();
  47. }
  48. else {
  49. planner.synchronize();
  50. if (parser.seen('X')) disable_X();
  51. if (parser.seen('Y')) disable_Y();
  52. if (parser.seen('Z')) disable_Z();
  53. // Only disable on boards that have separate ENABLE_PINS or another method for disabling the driver
  54. #if (E0_ENABLE_PIN != X_ENABLE_PIN && E1_ENABLE_PIN != Y_ENABLE_PIN) || AXIS_DRIVER_TYPE(E0, TMC2660) || AXIS_DRIVER_TYPE(E1, TMC2660) || AXIS_DRIVER_TYPE(E2, TMC2660) || AXIS_DRIVER_TYPE(E3, TMC2660) || AXIS_DRIVER_TYPE(E4, TMC2660) || AXIS_DRIVER_TYPE(E5, TMC2660)
  55. if (parser.seen('E')) disable_e_steppers();
  56. #endif
  57. }
  58. #if HAS_LCD_MENU && ENABLED(AUTO_BED_LEVELING_UBL)
  59. if (ubl.lcd_map_control) {
  60. ubl.lcd_map_control = false;
  61. ui.defer_status_screen(false);
  62. }
  63. #endif
  64. }
  65. }