Add multi-extruder condition

This commit is contained in:
Scott Lahteine
2020-09-20 18:29:08 -05:00
parent 8e0fac897b
commit 76d8d1742c
50 changed files with 127 additions and 144 deletions

View File

@ -22,7 +22,7 @@
#include "../../inc/MarlinConfigPre.h"
#if EXTRUDERS > 1
#if HAS_MULTI_EXTRUDER
#include "../gcode.h"
#include "../../module/tool_change.h"
@ -170,4 +170,4 @@ void GcodeSuite::M217() {
M217_report();
}
#endif // EXTRUDERS > 1
#endif // HAS_MULTI_EXTRUDER

View File

@ -23,7 +23,7 @@
#include "../gcode.h"
#include "../../module/tool_change.h"
#if ENABLED(DEBUG_LEVELING_FEATURE) || EXTRUDERS > 1
#if EITHER(HAS_MULTI_EXTRUDER, DEBUG_LEVELING_FEATURE)
#include "../../module/motion.h"
#endif

View File

@ -33,11 +33,11 @@
* TODO: Handle 'G10 P' for tool settings and 'G10 L' for workspace settings
*/
void GcodeSuite::G10() {
#if EXTRUDERS > 1
#if HAS_MULTI_EXTRUDER
const bool rs = parser.boolval('S');
#endif
fwretract.retract(true
#if EXTRUDERS > 1
#if HAS_MULTI_EXTRUDER
, rs
#endif
);

View File

@ -29,7 +29,7 @@
#include "../../../module/motion.h"
#include "../../../module/printcounter.h"
#if EXTRUDERS > 1
#if HAS_MULTI_EXTRUDER
#include "../../../module/tool_change.h"
#endif
@ -105,7 +105,7 @@ void GcodeSuite::M600() {
if (!all_axes_known()) home_all_axes();
#endif
#if EXTRUDERS > 1
#if HAS_MULTI_EXTRUDER
// Change toolhead if specified
const uint8_t active_extruder_before_filament_change = active_extruder;
if (active_extruder != target_extruder && TERN1(DUAL_X_CARRIAGE, !dxc_is_duplicating()))
@ -163,7 +163,7 @@ void GcodeSuite::M600() {
#endif
}
#if EXTRUDERS > 1
#if HAS_MULTI_EXTRUDER
// Restore toolhead if it was changed
if (active_extruder_before_filament_change != active_extruder)
tool_change(active_extruder_before_filament_change, false);

View File

@ -29,7 +29,7 @@
#include "../../../module/motion.h"
#include "../../../module/printcounter.h"
#if EXTRUDERS > 1
#if HAS_MULTI_EXTRUDER
#include "../../../module/tool_change.h"
#endif

View File

@ -30,7 +30,7 @@
#include "../../../module/temperature.h"
#include "../../../feature/pause.h"
#if EXTRUDERS > 1
#if HAS_MULTI_EXTRUDER
#include "../../../module/tool_change.h"
#endif
@ -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 EXTRUDERS > 1 && DISABLED(PRUSA_MMU2)
#if HAS_MULTI_EXTRUDER && DISABLED(PRUSA_MMU2)
// Change toolhead if specified
uint8_t active_extruder_before_filament_change = active_extruder;
if (active_extruder != target_extruder)
@ -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 EXTRUDERS > 1 && DISABLED(PRUSA_MMU2)
#if HAS_MULTI_EXTRUDER && DISABLED(PRUSA_MMU2)
// 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 EXTRUDERS > 1 && DISABLED(PRUSA_MMU2)
#if HAS_MULTI_EXTRUDER && DISABLED(PRUSA_MMU2)
// Change toolhead if specified
uint8_t active_extruder_before_filament_change = active_extruder;
if (active_extruder != target_extruder)
@ -201,7 +201,7 @@ void GcodeSuite::M702() {
#if ENABLED(PRUSA_MMU2)
mmu2.unload();
#else
#if EXTRUDERS > 1 && ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS)
#if BOTH(HAS_MULTI_EXTRUDER, FILAMENT_UNLOAD_ALL_EXTRUDERS)
if (!parser.seenval('T')) {
HOTEND_LOOP() {
if (e != active_extruder) tool_change(e, false);
@ -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 EXTRUDERS > 1 && DISABLED(PRUSA_MMU2)
#if HAS_MULTI_EXTRUDER && DISABLED(PRUSA_MMU2)
// Restore toolhead if it was changed
if (active_extruder_before_filament_change != active_extruder)
tool_change(active_extruder_before_filament_change, false);

View File

@ -614,7 +614,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 211: M211(); break; // M211: Enable, Disable, and/or Report software endstops
#endif
#if EXTRUDERS > 1
#if HAS_MULTI_EXTRUDER
case 217: M217(); break; // M217: Set filament swap parameters
#endif

View File

@ -661,9 +661,7 @@ private:
static void M211();
#if EXTRUDERS > 1
static void M217();
#endif
TERN_(HAS_MULTI_EXTRUDER, static void M217());
TERN_(HAS_HOTEND_OFFSET, static void M218());