From a8ac83bbca1b6aed52e6cfa9a7b219cadd8c20b7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 29 Mar 2023 22:34:07 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20=5FHAS=5FFAN=20for=20fan?= =?UTF-8?q?=20on=20Pin=200?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Conditionals_post.h | 13 ++++++------- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 1 - 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 4e36b726c8..ad8d9d36fd 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -2605,14 +2605,13 @@ #define MAX_FANS 8 // Max supported fans #endif -#define _NOT_E_AUTO(N,F) (E##N##_AUTO_FAN_PIN != FAN##F##_PIN) -#define _HAS_FAN(F) (PIN_EXISTS(FAN##F) \ +#define _IS_E_AUTO(N,F) (PIN_EXISTS(E##N##_AUTO_FAN) && E##N##_AUTO_FAN_PIN == FAN##F##_PIN) +#define _HAS_FAN(F) (F < MAX_FANS && PIN_EXISTS(FAN##F) \ && CONTROLLER_FAN_PIN != FAN##F##_PIN \ - && _NOT_E_AUTO(0,F) && _NOT_E_AUTO(1,F) \ - && _NOT_E_AUTO(2,F) && _NOT_E_AUTO(3,F) \ - && _NOT_E_AUTO(4,F) && _NOT_E_AUTO(5,F) \ - && _NOT_E_AUTO(6,F) && _NOT_E_AUTO(7,F) \ - && F < MAX_FANS) + && !_IS_E_AUTO(0,F) && !_IS_E_AUTO(1,F) \ + && !_IS_E_AUTO(2,F) && !_IS_E_AUTO(3,F) \ + && !_IS_E_AUTO(4,F) && !_IS_E_AUTO(5,F) \ + && !_IS_E_AUTO(6,F) && !_IS_E_AUTO(7,F)) #if _HAS_FAN(0) #define HAS_FAN0 1 #endif diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index d90e4df5af..d4b4280671 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -38,7 +38,6 @@ #include "../../../module/planner.h" #include "../../../module/settings.h" #include "../../../libs/buzzer.h" -#include "../../../inc/Conditionals_post.h" //#define DEBUG_OUT 1 #include "../../../core/debug_out.h"