Browse Source

[2.0.x] Optional heater signal inversion (#10260)

pull/1/head
Karl Andersson 7 years ago
committed by Scott Lahteine
parent
commit
7cbbc2af7a
  1. 35
      Marlin/src/inc/Conditionals_post.h
  2. 12
      Marlin/src/module/temperature.cpp

35
Marlin/src/inc/Conditionals_post.h

@ -831,18 +831,43 @@
#define EXTRUDE_MINTEMP 170
#endif
/**
* Heater signal inversion defaults
*/
#if HAS_HEATER_0 && !defined(HEATER_0_INVERTING)
#define HEATER_0_INVERTING false
#endif
#if HAS_HEATER_1 && !defined(HEATER_1_INVERTING)
#define HEATER_1_INVERTING false
#endif
#if HAS_HEATER_2 && !defined(HEATER_2_INVERTING)
#define HEATER_2_INVERTING false
#endif
#if HAS_HEATER_3 && !defined(HEATER_3_INVERTING)
#define HEATER_3_INVERTING false
#endif
#if HAS_HEATER_4 && !defined(HEATER_4_INVERTING)
#define HEATER_4_INVERTING false
#endif
/**
* Helper Macros for heaters and extruder fan
*/
#define WRITE_HEATER_0P(v) WRITE(HEATER_0_PIN, v)
#define WRITE_HEATER_0P(v) WRITE(HEATER_0_PIN, (v) ^ HEATER_0_INVERTING)
#if HOTENDS > 1 || ENABLED(HEATERS_PARALLEL)
#define WRITE_HEATER_1(v) WRITE(HEATER_1_PIN, v)
#define WRITE_HEATER_1(v) WRITE(HEATER_1_PIN, (v) ^ HEATER_1_INVERTING)
#if HOTENDS > 2
#define WRITE_HEATER_2(v) WRITE(HEATER_2_PIN, v)
#define WRITE_HEATER_2(v) WRITE(HEATER_2_PIN, (v) ^ HEATER_2_INVERTING)
#if HOTENDS > 3
#define WRITE_HEATER_3(v) WRITE(HEATER_3_PIN, v)
#define WRITE_HEATER_3(v) WRITE(HEATER_3_PIN, (v) ^ HEATER_3_INVERTING)
#if HOTENDS > 4
#define WRITE_HEATER_4(v) WRITE(HEATER_4_PIN, v)
#define WRITE_HEATER_4(v) WRITE(HEATER_4_PIN, (v) ^ HEATER_4_INVERTING)
#endif // HOTENDS > 4
#endif // HOTENDS > 3
#endif // HOTENDS > 2

12
Marlin/src/module/temperature.cpp

@ -1085,22 +1085,22 @@ void Temperature::init() {
#endif
#if HAS_HEATER_0
SET_OUTPUT(HEATER_0_PIN);
OUT_WRITE(HEATER_0_PIN, HEATER_0_INVERTING);
#endif
#if HAS_HEATER_1
SET_OUTPUT(HEATER_1_PIN);
OUT_WRITE(HEATER_1_PIN, HEATER_1_INVERTING);
#endif
#if HAS_HEATER_2
SET_OUTPUT(HEATER_2_PIN);
OUT_WRITE(HEATER_2_PIN, HEATER_2_INVERTING);
#endif
#if HAS_HEATER_3
SET_OUTPUT(HEATER_3_PIN);
OUT_WRITE(HEATER_3_PIN, HEATER_3_INVERTING);
#endif
#if HAS_HEATER_4
SET_OUTPUT(HEATER_3_PIN);
OUT_WRITE(HEATER_3_PIN, HEATER_4_INVERTING);
#endif
#if HAS_HEATER_BED
SET_OUTPUT(HEATER_BED_PIN);
OUT_WRITE(HEATER_BED_PIN, HEATER_BED_INVERTING);
#endif
#if HAS_FAN0

Loading…
Cancel
Save