From ca917eadfb9815c81cc8a0288870662e78a6a558 Mon Sep 17 00:00:00 2001 From: InsanityAutomation Date: Sat, 22 Jun 2019 14:53:14 -0400 Subject: [PATCH] Fix filament runout on T1 when duplicating --- Marlin/runout.h | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/Marlin/runout.h b/Marlin/runout.h index 0bfda721a3..cf3377b780 100644 --- a/Marlin/runout.h +++ b/Marlin/runout.h @@ -62,18 +62,23 @@ class FilamentRunoutSensor { #else // Read the sensor for the active extruder bool is_out; - switch (active_extruder) { - case 0: is_out = READ(FIL_RUNOUT_PIN) == FIL_RUNOUT_INVERTING; break; - case 1: is_out = READ(FIL_RUNOUT2_PIN) == FIL_RUNOUT_INVERTING; break; - #if NUM_RUNOUT_SENSORS > 2 - case 2: is_out = READ(FIL_RUNOUT3_PIN) == FIL_RUNOUT_INVERTING; break; - #if NUM_RUNOUT_SENSORS > 3 - case 3: is_out = READ(FIL_RUNOUT4_PIN) == FIL_RUNOUT_INVERTING; break; - #if NUM_RUNOUT_SENSORS > 4 - case 4: is_out = READ(FIL_RUNOUT5_PIN) == FIL_RUNOUT_INVERTING; break; + if(dual_x_carriage_mode >= DXC_DUPLICATION_MODE) + { + is_out = (READ(FIL_RUNOUT_PIN) == FIL_RUNOUT_INVERTING) || (READ(FIL_RUNOUT2_PIN) == FIL_RUNOUT_INVERTING); + } else { + switch (active_extruder) { + case 0: is_out = READ(FIL_RUNOUT_PIN) == FIL_RUNOUT_INVERTING; break; + case 1: is_out = READ(FIL_RUNOUT2_PIN) == FIL_RUNOUT_INVERTING; break; + #if NUM_RUNOUT_SENSORS > 2 + case 2: is_out = READ(FIL_RUNOUT3_PIN) == FIL_RUNOUT_INVERTING; break; + #if NUM_RUNOUT_SENSORS > 3 + case 3: is_out = READ(FIL_RUNOUT4_PIN) == FIL_RUNOUT_INVERTING; break; + #if NUM_RUNOUT_SENSORS > 4 + case 4: is_out = READ(FIL_RUNOUT5_PIN) == FIL_RUNOUT_INVERTING; break; + #endif #endif #endif - #endif + } } #endif return (is_out ? ++runout_count : (runout_count = 0)) > FIL_RUNOUT_THRESHOLD;