From c18294d83cc891c47d5abe56a4842adbe6fbb1aa Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 21 Dec 2023 15:30:03 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Optional=20FAN=5FINVERTING?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Conditionals_post.h | 4 ---- Marlin/src/module/temperature.cpp | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 42379506ced7..04e96177b5d1 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -2728,10 +2728,6 @@ #define HAS_FAN 1 #endif -#ifndef FAN_INVERTING - #define FAN_INVERTING false -#endif - #if PIN_EXISTS(FANMUX0) #define HAS_FANMUX 1 // Part Cooling fan multipliexer #endif diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index fc9e08fe7cac..afde7d3b3497 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -370,9 +370,9 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED); // Init fans according to whether they're native PWM or Software PWM #ifdef BOARD_OPENDRAIN_MOSFETS - #define _INIT_SOFT_FAN(P) OUT_WRITE_OD(P, FAN_INVERTING ? LOW : HIGH) + #define _INIT_SOFT_FAN(P) OUT_WRITE_OD(P, ENABLED(FAN_INVERTING) ? LOW : HIGH) #else - #define _INIT_SOFT_FAN(P) OUT_WRITE(P, FAN_INVERTING ? LOW : HIGH) + #define _INIT_SOFT_FAN(P) OUT_WRITE(P, ENABLED(FAN_INVERTING) ? LOW : HIGH) #endif #if ENABLED(FAN_SOFT_PWM) #define _INIT_FAN_PIN(P) _INIT_SOFT_FAN(P) @@ -3819,7 +3819,7 @@ void Temperature::isr() { static SoftPWM soft_pwm_controller; #endif - #define WRITE_FAN(n, v) WRITE(FAN##n##_PIN, (v) ^ FAN_INVERTING) + #define WRITE_FAN(n, v) WRITE(FAN##n##_PIN, (v) ^ ENABLED(FAN_INVERTING)) #if DISABLED(SLOW_PWM_HEATERS)