diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 416caf22fc..070309d5aa 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -194,8 +194,6 @@ */ //#define HEPHESTOS2_HEATED_BED_KIT #if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #undef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 70 #define HEATER_BED_INVERTING true #endif diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index bf9ede65dc..4e36b726c8 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -2799,54 +2799,24 @@ #define HAS_MICROSTEPS 1 #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 -#if HAS_HEATER_5 && !defined(HEATER_5_INVERTING) - #define HEATER_5_INVERTING false -#endif -#if HAS_HEATER_6 && !defined(HEATER_6_INVERTING) - #define HEATER_6_INVERTING false -#endif -#if HAS_HEATER_7 && !defined(HEATER_7_INVERTING) - #define HEATER_7_INVERTING false -#endif - /** * Helper Macros for heaters and extruder fan */ - -#define WRITE_HEATER_0P(v) WRITE(HEATER_0_PIN, (v) ^ HEATER_0_INVERTING) +#define WRITE_HEATER_0P(v) WRITE(HEATER_0_PIN, (v) ^ ENABLED(HEATER_0_INVERTING)) #if EITHER(HAS_MULTI_HOTEND, HEATERS_PARALLEL) - #define WRITE_HEATER_1(v) WRITE(HEATER_1_PIN, (v) ^ HEATER_1_INVERTING) + #define WRITE_HEATER_1(v) WRITE(HEATER_1_PIN, (v) ^ ENABLED(HEATER_1_INVERTING)) #if HOTENDS > 2 - #define WRITE_HEATER_2(v) WRITE(HEATER_2_PIN, (v) ^ HEATER_2_INVERTING) + #define WRITE_HEATER_2(v) WRITE(HEATER_2_PIN, (v) ^ ENABLED(HEATER_2_INVERTING)) #if HOTENDS > 3 - #define WRITE_HEATER_3(v) WRITE(HEATER_3_PIN, (v) ^ HEATER_3_INVERTING) + #define WRITE_HEATER_3(v) WRITE(HEATER_3_PIN, (v) ^ ENABLED(HEATER_3_INVERTING)) #if HOTENDS > 4 - #define WRITE_HEATER_4(v) WRITE(HEATER_4_PIN, (v) ^ HEATER_4_INVERTING) + #define WRITE_HEATER_4(v) WRITE(HEATER_4_PIN, (v) ^ ENABLED(HEATER_4_INVERTING)) #if HOTENDS > 5 - #define WRITE_HEATER_5(v) WRITE(HEATER_5_PIN, (v) ^ HEATER_5_INVERTING) + #define WRITE_HEATER_5(v) WRITE(HEATER_5_PIN, (v) ^ ENABLED(HEATER_5_INVERTING)) #if HOTENDS > 6 - #define WRITE_HEATER_6(v) WRITE(HEATER_6_PIN, (v) ^ HEATER_6_INVERTING) + #define WRITE_HEATER_6(v) WRITE(HEATER_6_PIN, (v) ^ ENABLED(HEATER_6_INVERTING)) #if HOTENDS > 7 - #define WRITE_HEATER_7(v) WRITE(HEATER_7_PIN, (v) ^ HEATER_7_INVERTING) + #define WRITE_HEATER_7(v) WRITE(HEATER_7_PIN, (v) ^ ENABLED(HEATER_7_INVERTING)) #endif // HOTENDS > 7 #endif // HOTENDS > 6 #endif // HOTENDS > 5 @@ -2860,10 +2830,6 @@ #define WRITE_HEATER_0(v) WRITE_HEATER_0P(v) #endif -#ifndef MIN_POWER - #define MIN_POWER 0 -#endif - /** * Heated bed requires settings */ @@ -2874,10 +2840,7 @@ #ifndef MAX_BED_POWER #define MAX_BED_POWER 255 #endif - #ifndef HEATER_BED_INVERTING - #define HEATER_BED_INVERTING false - #endif - #define WRITE_HEATER_BED(v) WRITE(HEATER_BED_PIN, (v) ^ HEATER_BED_INVERTING) + #define WRITE_HEATER_BED(v) WRITE(HEATER_BED_PIN, (v) ^ ENABLED(HEATER_BED_INVERTING)) #endif /** @@ -2890,10 +2853,7 @@ #ifndef MAX_CHAMBER_POWER #define MAX_CHAMBER_POWER 255 #endif - #ifndef HEATER_CHAMBER_INVERTING - #define HEATER_CHAMBER_INVERTING false - #endif - #define WRITE_HEATER_CHAMBER(v) WRITE(HEATER_CHAMBER_PIN, (v) ^ HEATER_CHAMBER_INVERTING) + #define WRITE_HEATER_CHAMBER(v) WRITE(HEATER_CHAMBER_PIN, (v) ^ ENABLED(HEATER_CHAMBER_INVERTING)) #endif /** @@ -2903,10 +2863,7 @@ #ifndef MAX_COOLER_POWER #define MAX_COOLER_POWER 255 #endif - #ifndef COOLER_INVERTING - #define COOLER_INVERTING true - #endif - #define WRITE_HEATER_COOLER(v) WRITE(COOLER_PIN, (v) ^ COOLER_INVERTING) + #define WRITE_HEATER_COOLER(v) WRITE(COOLER_PIN, (v) ^ ENABLED(COOLER_INVERTING)) #endif #if HAS_HOTEND || HAS_HEATED_BED || HAS_HEATED_CHAMBER || HAS_COOLER diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index c92cc64c65..a18ced531e 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -736,6 +736,17 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L #undef _ISMAX_1 #undef _ISSNS_1 +/** + * Hephestos 2 Heated Bed Kit requirements + */ +#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) + #if TEMP_SENSOR_BED != 70 + #error "HEPHESTOS2_HEATED_BED_KIT requires TEMP_SENSOR_BED 70." + #elif DISABLED(HEATER_BED_INVERTING) + #error "HEPHESTOS2_HEATED_BED_KIT requires HEATER_BED_INVERTING." + #endif +#endif + /** * Probe temp compensation requirements */ diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 180dbbc5ad..29c3a787c5 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -2630,47 +2630,47 @@ void Temperature::init() { #if HAS_HEATER_0 #ifdef BOARD_OPENDRAIN_MOSFETS - OUT_WRITE_OD(HEATER_0_PIN, HEATER_0_INVERTING); + OUT_WRITE_OD(HEATER_0_PIN, ENABLED(HEATER_0_INVERTING)); #else - OUT_WRITE(HEATER_0_PIN, HEATER_0_INVERTING); + OUT_WRITE(HEATER_0_PIN, ENABLED(HEATER_0_INVERTING)); #endif #endif #if HAS_HEATER_1 - OUT_WRITE(HEATER_1_PIN, HEATER_1_INVERTING); + OUT_WRITE(HEATER_1_PIN, ENABLED(HEATER_1_INVERTING)); #endif #if HAS_HEATER_2 - OUT_WRITE(HEATER_2_PIN, HEATER_2_INVERTING); + OUT_WRITE(HEATER_2_PIN, ENABLED(HEATER_2_INVERTING)); #endif #if HAS_HEATER_3 - OUT_WRITE(HEATER_3_PIN, HEATER_3_INVERTING); + OUT_WRITE(HEATER_3_PIN, ENABLED(HEATER_3_INVERTING)); #endif #if HAS_HEATER_4 - OUT_WRITE(HEATER_4_PIN, HEATER_4_INVERTING); + OUT_WRITE(HEATER_4_PIN, ENABLED(HEATER_4_INVERTING)); #endif #if HAS_HEATER_5 - OUT_WRITE(HEATER_5_PIN, HEATER_5_INVERTING); + OUT_WRITE(HEATER_5_PIN, ENABLED(HEATER_5_INVERTING)); #endif #if HAS_HEATER_6 - OUT_WRITE(HEATER_6_PIN, HEATER_6_INVERTING); + OUT_WRITE(HEATER_6_PIN, ENABLED(HEATER_6_INVERTING)); #endif #if HAS_HEATER_7 - OUT_WRITE(HEATER_7_PIN, HEATER_7_INVERTING); + OUT_WRITE(HEATER_7_PIN, ENABLED(HEATER_7_INVERTING)); #endif #if HAS_HEATED_BED #ifdef BOARD_OPENDRAIN_MOSFETS - OUT_WRITE_OD(HEATER_BED_PIN, HEATER_BED_INVERTING); + OUT_WRITE_OD(HEATER_BED_PIN, ENABLED(HEATER_BED_INVERTING)); #else - OUT_WRITE(HEATER_BED_PIN, HEATER_BED_INVERTING); + OUT_WRITE(HEATER_BED_PIN, ENABLED(HEATER_BED_INVERTING)); #endif #endif #if HAS_HEATED_CHAMBER - OUT_WRITE(HEATER_CHAMBER_PIN, HEATER_CHAMBER_INVERTING); + OUT_WRITE(HEATER_CHAMBER_PIN, ENABLED(HEATER_CHAMBER_INVERTING)); #endif #if HAS_COOLER - OUT_WRITE(COOLER_PIN, COOLER_INVERTING); + OUT_WRITE(COOLER_PIN, ENABLED(COOLER_INVERTING)); #endif #if HAS_FAN0 diff --git a/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h b/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h index cd3ada25bf..efedb8ffaf 100644 --- a/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h +++ b/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h @@ -121,9 +121,10 @@ #include "pins_RAMPS_13.h" // ... RAMPS // -// Used by the Hephestos 2 heated bed upgrade kit +// Hephestos 2 heated bed upgrade kit uses pin 8 // #if ENABLED(HEPHESTOS2_HEATED_BED_KIT) #undef HEATER_BED_PIN #define HEATER_BED_PIN 8 + #define HEATER_BED_INVERTING true #endif