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.

M207-M209.cpp 2.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2019 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 "../../../inc/MarlinConfig.h"
  23. #if ENABLED(FWRETRACT)
  24. #include "../../../feature/fwretract.h"
  25. #include "../../gcode.h"
  26. /**
  27. * M207: Set firmware retraction values
  28. *
  29. * S[+units] retract_length
  30. * W[+units] swap_retract_length (multi-extruder)
  31. * F[units/min] retract_feedrate_mm_s
  32. * Z[units] retract_zraise
  33. */
  34. void GcodeSuite::M207() {
  35. if (parser.seen('S')) fwretract.settings.retract_length = parser.value_axis_units(E_AXIS);
  36. if (parser.seen('F')) fwretract.settings.retract_feedrate_mm_s = MMM_TO_MMS(parser.value_axis_units(E_AXIS));
  37. if (parser.seen('Z')) fwretract.settings.retract_zraise = parser.value_linear_units();
  38. if (parser.seen('W')) fwretract.settings.swap_retract_length = parser.value_axis_units(E_AXIS);
  39. }
  40. /**
  41. * M208: Set firmware un-retraction values
  42. *
  43. * S[+units] retract_recover_extra (in addition to M207 S*)
  44. * W[+units] swap_retract_recover_extra (multi-extruder)
  45. * F[units/min] retract_recover_feedrate_mm_s
  46. * R[units/min] swap_retract_recover_feedrate_mm_s
  47. */
  48. void GcodeSuite::M208() {
  49. if (parser.seen('S')) fwretract.settings.retract_recover_extra = parser.value_axis_units(E_AXIS);
  50. if (parser.seen('F')) fwretract.settings.retract_recover_feedrate_mm_s = MMM_TO_MMS(parser.value_axis_units(E_AXIS));
  51. if (parser.seen('R')) fwretract.settings.swap_retract_recover_feedrate_mm_s = MMM_TO_MMS(parser.value_axis_units(E_AXIS));
  52. if (parser.seen('W')) fwretract.settings.swap_retract_recover_extra = parser.value_axis_units(E_AXIS);
  53. }
  54. #if ENABLED(FWRETRACT_AUTORETRACT)
  55. /**
  56. * M209: Enable automatic retract (M209 S1)
  57. * For slicers that don't support G10/11, reversed extrude-only
  58. * moves will be classified as retraction.
  59. */
  60. void GcodeSuite::M209() {
  61. if (MIN_AUTORETRACT <= MAX_AUTORETRACT && parser.seen('S'))
  62. fwretract.enable_autoretract(parser.value_bool());
  63. }
  64. #endif // FWRETRACT_AUTORETRACT
  65. #endif // FWRETRACT