Skip to content
Snippets Groups Projects
Commit 4df9509e authored by pinchies's avatar pinchies Committed by Scott Lahteine
Browse files

Add support for printers with inverted fan pins (#13362)

Add support for printers with inverted fan pins by adding `#define FAN_INVERTING 1` to `Configuration_adv.h` and modifying the fan write macros.
parent 1f7e2203
Branches
Tags
No related merge requests found
...@@ -1169,6 +1169,10 @@ ...@@ -1169,6 +1169,10 @@
/** /**
* Up to 3 PWM fans * Up to 3 PWM fans
*/ */
#ifndef FAN_INVERTING
#define FAN_INVERTING false
#endif
#if HAS_FAN2 #if HAS_FAN2
#define FAN_COUNT 3 #define FAN_COUNT 3
#elif HAS_FAN1 #elif HAS_FAN1
...@@ -1180,14 +1184,14 @@ ...@@ -1180,14 +1184,14 @@
#endif #endif
#if HAS_FAN0 #if HAS_FAN0
#define WRITE_FAN(v) WRITE(FAN_PIN, v) #define WRITE_FAN(v) WRITE(FAN_PIN, (v) ^ FAN_INVERTING)
#define WRITE_FAN0(v) WRITE_FAN(v) #define WRITE_FAN0(v) WRITE_FAN(v)
#endif #endif
#if HAS_FAN1 #if HAS_FAN1
#define WRITE_FAN1(v) WRITE(FAN1_PIN, v) #define WRITE_FAN1(v) WRITE(FAN1_PIN, (v) ^ FAN_INVERTING)
#endif #endif
#if HAS_FAN2 #if HAS_FAN2
#define WRITE_FAN2(v) WRITE(FAN2_PIN, v) #define WRITE_FAN2(v) WRITE(FAN2_PIN, (v) ^ FAN_INVERTING)
#endif #endif
#define WRITE_FAN_N(n, v) WRITE_FAN##n(v) #define WRITE_FAN_N(n, v) WRITE_FAN##n(v)
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment