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.
This commit is contained in:
pinchies 2019-03-11 12:51:21 +11:00 committed by Scott Lahteine
parent 1f7e220387
commit 4df9509ead

View File

@ -1169,6 +1169,10 @@
/**
* Up to 3 PWM fans
*/
#ifndef FAN_INVERTING
#define FAN_INVERTING false
#endif
#if HAS_FAN2
#define FAN_COUNT 3
#elif HAS_FAN1
@ -1180,14 +1184,14 @@
#endif
#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)
#endif
#if HAS_FAN1
#define WRITE_FAN1(v) WRITE(FAN1_PIN, v)
#define WRITE_FAN1(v) WRITE(FAN1_PIN, (v) ^ FAN_INVERTING)
#endif
#if HAS_FAN2
#define WRITE_FAN2(v) WRITE(FAN2_PIN, v)
#define WRITE_FAN2(v) WRITE(FAN2_PIN, (v) ^ FAN_INVERTING)
#endif
#define WRITE_FAN_N(n, v) WRITE_FAN##n(v)