Skip to content

Commit

Permalink
🔧 Optional FAN_INVERTING
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Dec 21, 2023
1 parent 401ba66 commit c18294d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 0 additions & 4 deletions Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/module/temperature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit c18294d

Please sign in to comment.