From 59cf217e7729a1c59493338ec465f1c68c912f43 Mon Sep 17 00:00:00 2001 From: Jeonghwan Roh Date: Mon, 27 Aug 2018 16:25:47 +0900 Subject: [PATCH] Fix 5 mixing steppers --- Marlin/src/Marlin.h | 5 ++++- Marlin/src/feature/power.cpp | 18 ++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Marlin/src/Marlin.h b/Marlin/src/Marlin.h index 7c919f9e0..792bee8a4 100644 --- a/Marlin/src/Marlin.h +++ b/Marlin/src/Marlin.h @@ -80,7 +80,10 @@ void manage_inactivity(const bool ignore_stepper_queue=false); /** * Mixing steppers synchronize their enable (and direction) together */ - #if MIXING_STEPPERS > 3 + #if MIXING_STEPPERS > 4 + #define enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); E3_ENABLE_WRITE( E_ENABLE_ON); E4_ENABLE_WRITE( E_ENABLE_ON); } + #define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); E3_ENABLE_WRITE(!E_ENABLE_ON); E4_ENABLE_WRITE(!E_ENABLE_ON); } + #elif MIXING_STEPPERS > 3 #define enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); E3_ENABLE_WRITE( E_ENABLE_ON); } #define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); E3_ENABLE_WRITE(!E_ENABLE_ON); } #elif MIXING_STEPPERS > 2 diff --git a/Marlin/src/feature/power.cpp b/Marlin/src/feature/power.cpp index 0591faec6..53fcd142b 100644 --- a/Marlin/src/feature/power.cpp +++ b/Marlin/src/feature/power.cpp @@ -50,20 +50,30 @@ bool Power::is_power_needed() { if (controllerFanSpeed > 0) return true; #endif + // If any of the drivers or the bed are enabled... if (X_ENABLE_READ == X_ENABLE_ON || Y_ENABLE_READ == Y_ENABLE_ON || Z_ENABLE_READ == Z_ENABLE_ON #if HAS_HEATED_BED || thermalManager.soft_pwm_amount_bed > 0 #endif - || E0_ENABLE_READ == E_ENABLE_ON // If any of the drivers are enabled... + #if HAS_X2_ENABLE + || X2_ENABLE_READ == X_ENABLE_ON + #endif + #if HAS_Y2_ENABLE + || Y2_ENABLE_READ == Y_ENABLE_ON + #endif + #if HAS_Z2_ENABLE + || Z2_ENABLE_READ == Z_ENABLE_ON + #endif + || E0_ENABLE_READ == E_ENABLE_ON #if E_STEPPERS > 1 || E1_ENABLE_READ == E_ENABLE_ON - #if HAS_X2_ENABLE - || X2_ENABLE_READ == X_ENABLE_ON - #endif #if E_STEPPERS > 2 || E2_ENABLE_READ == E_ENABLE_ON #if E_STEPPERS > 3 || E3_ENABLE_READ == E_ENABLE_ON + #if E_STEPPERS > 4 + || E4_ENABLE_READ == E_ENABLE_ON + #endif #endif #endif #endif