SMUFF (MMU2 clone) support (#19912)

This commit is contained in:
Giuliano Zaro
2020-11-18 08:27:21 +01:00
committed by GitHub
parent 11b811820f
commit 41529b6598
29 changed files with 622 additions and 616 deletions

View File

@ -38,8 +38,8 @@
#include "../../../lcd/marlinui.h"
#endif
#if ENABLED(PRUSA_MMU2)
#include "../../../feature/mmu2/mmu2.h"
#if HAS_PRUSA_MMU2
#include "../../../feature/mmu/mmu2.h"
#endif
#if ENABLED(MIXING_EXTRUDER)
@ -86,7 +86,7 @@ void GcodeSuite::M701() {
// Show initial "wait for load" message
TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_LOAD, PAUSE_MODE_LOAD_FILAMENT, target_extruder));
#if HAS_MULTI_EXTRUDER && DISABLED(PRUSA_MMU2)
#if HAS_MULTI_EXTRUDER && (HAS_PRUSA_MMU1 || !HAS_MMU)
// Change toolhead if specified
uint8_t active_extruder_before_filament_change = active_extruder;
if (active_extruder != target_extruder)
@ -98,7 +98,7 @@ void GcodeSuite::M701() {
do_blocking_move_to_z(_MIN(current_position.z + park_point.z, Z_MAX_POS), feedRate_t(NOZZLE_PARK_Z_FEEDRATE));
// Load filament
#if ENABLED(PRUSA_MMU2)
#if HAS_PRUSA_MMU2
mmu2.load_filament_to_nozzle(target_extruder);
#else
constexpr float purge_length = ADVANCED_PAUSE_PURGE_LENGTH,
@ -121,7 +121,7 @@ void GcodeSuite::M701() {
if (park_point.z > 0)
do_blocking_move_to_z(_MAX(current_position.z - park_point.z, 0), feedRate_t(NOZZLE_PARK_Z_FEEDRATE));
#if HAS_MULTI_EXTRUDER && DISABLED(PRUSA_MMU2)
#if HAS_MULTI_EXTRUDER && (HAS_PRUSA_MMU1 || !HAS_MMU)
// Restore toolhead if it was changed
if (active_extruder_before_filament_change != active_extruder)
tool_change(active_extruder_before_filament_change, false);
@ -186,7 +186,7 @@ void GcodeSuite::M702() {
// Show initial "wait for unload" message
TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_UNLOAD, PAUSE_MODE_UNLOAD_FILAMENT, target_extruder));
#if HAS_MULTI_EXTRUDER && DISABLED(PRUSA_MMU2)
#if HAS_MULTI_EXTRUDER && (HAS_PRUSA_MMU1 || !HAS_MMU)
// Change toolhead if specified
uint8_t active_extruder_before_filament_change = active_extruder;
if (active_extruder != target_extruder)
@ -198,7 +198,7 @@ void GcodeSuite::M702() {
do_blocking_move_to_z(_MIN(current_position.z + park_point.z, Z_MAX_POS), feedRate_t(NOZZLE_PARK_Z_FEEDRATE));
// Unload filament
#if ENABLED(PRUSA_MMU2)
#if HAS_PRUSA_MMU2
mmu2.unload();
#else
#if BOTH(HAS_MULTI_EXTRUDER, FILAMENT_UNLOAD_ALL_EXTRUDERS)
@ -227,7 +227,7 @@ void GcodeSuite::M702() {
if (park_point.z > 0)
do_blocking_move_to_z(_MAX(current_position.z - park_point.z, 0), feedRate_t(NOZZLE_PARK_Z_FEEDRATE));
#if HAS_MULTI_EXTRUDER && DISABLED(PRUSA_MMU2)
#if HAS_MULTI_EXTRUDER && (HAS_PRUSA_MMU1 || !HAS_MMU)
// Restore toolhead if it was changed
if (active_extruder_before_filament_change != active_extruder)
tool_change(active_extruder_before_filament_change, false);

View File

@ -22,10 +22,10 @@
#include "../../../inc/MarlinConfigPre.h"
#if ENABLED(PRUSA_MMU2)
#if HAS_PRUSA_MMU2
#include "../../gcode.h"
#include "../../../feature/mmu2/mmu2.h"
#include "../../../feature/mmu/mmu2.h"
/**
* M403: Set filament type for MMU2
@ -46,4 +46,4 @@ void GcodeSuite::M403() {
SERIAL_ECHO_MSG("M403 - bad arguments.");
}
#endif // PRUSA_MMU2
#endif // HAS_PRUSA_MMU2