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.

T.cpp 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. #include "../gcode.h"
  23. #include "../../module/tool_change.h"
  24. #if EITHER(HAS_MULTI_EXTRUDER, DEBUG_LEVELING_FEATURE)
  25. #include "../../module/motion.h"
  26. #endif
  27. #if HAS_PRUSA_MMU2
  28. #include "../../feature/mmu/mmu2.h"
  29. #endif
  30. #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
  31. #include "../../core/debug_out.h"
  32. /**
  33. * T0-T<n>: Switch tool, usually switching extruders
  34. *
  35. * F[units/min] Set the movement feedrate
  36. * S1 Don't move the tool in XY after change
  37. *
  38. * For PRUSA_MMU2(S) and EXTENDABLE_EMU_MMU2(S)
  39. * T[n] Gcode to extrude at least 38.10 mm at feedrate 19.02 mm/s must follow immediately to load to extruder wheels.
  40. * T? Gcode to extrude shouldn't have to follow. Load to extruder wheels is done automatically.
  41. * Tx Same as T?, but nozzle doesn't have to be preheated. Tc requires a preheated nozzle to finish filament load.
  42. * Tc Load to nozzle after filament was prepared by Tc and nozzle is already heated.
  43. */
  44. void GcodeSuite::T(const int8_t tool_index) {
  45. DEBUG_SECTION(log_T, "T", DEBUGGING(LEVELING));
  46. if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("...(", tool_index, ")");
  47. // Count this command as movement / activity
  48. reset_stepper_timeout();
  49. #if HAS_PRUSA_MMU2
  50. if (parser.string_arg) {
  51. mmu2.tool_change(parser.string_arg); // Special commands T?/Tx/Tc
  52. return;
  53. }
  54. #endif
  55. tool_change(tool_index
  56. #if HAS_MULTI_EXTRUDER
  57. , TERN(PARKING_EXTRUDER, false, tool_index == active_extruder) // For PARKING_EXTRUDER motion is decided in tool_change()
  58. || parser.boolval('S')
  59. #endif
  60. );
  61. }