🔧 Permit extrude without hotend (#25709)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
ellensp
2023-04-22 21:09:17 +12:00
committed by GitHub
parent 89ccede139
commit c8ed7950f4
7 changed files with 201 additions and 213 deletions

View File

@@ -581,7 +581,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 102: M102(); break; // M102: Configure Bed Distance Sensor case 102: M102(); break; // M102: Configure Bed Distance Sensor
#endif #endif
#if HAS_EXTRUDERS #if HAS_HOTEND
case 104: M104(); break; // M104: Set hot end temperature case 104: M104(); break; // M104: Set hot end temperature
case 109: M109(); break; // M109: Wait for hotend temperature to reach target case 109: M109(); break; // M109: Wait for hotend temperature to reach target
#endif #endif

View File

@@ -716,7 +716,7 @@ private:
static void M102_report(const bool forReplay=true); static void M102_report(const bool forReplay=true);
#endif #endif
#if HAS_EXTRUDERS #if HAS_HOTEND
static void M104_M109(const bool isM109); static void M104_M109(const bool isM109);
FORCE_INLINE static void M104() { M104_M109(false); } FORCE_INLINE static void M104() { M104_M109(false); }
FORCE_INLINE static void M109() { M104_M109(true); } FORCE_INLINE static void M109() { M104_M109(true); }

View File

@@ -28,7 +28,7 @@
#include "../../inc/MarlinConfigPre.h" #include "../../inc/MarlinConfigPre.h"
#if HAS_EXTRUDERS #if HAS_HOTEND
#include "../gcode.h" #include "../gcode.h"
#include "../../module/temperature.h" #include "../../module/temperature.h"
@@ -135,4 +135,4 @@ void GcodeSuite::M104_M109(const bool isM109) {
(void)thermalManager.wait_for_hotend(target_extruder, no_wait_for_cooling); (void)thermalManager.wait_for_hotend(target_extruder, no_wait_for_cooling);
} }
#endif // EXTRUDERS #endif // HAS_HOTEND

View File

@@ -624,8 +624,6 @@
#undef MIXING_EXTRUDER #undef MIXING_EXTRUDER
#undef HOTEND_IDLE_TIMEOUT #undef HOTEND_IDLE_TIMEOUT
#undef DISABLE_E #undef DISABLE_E
#undef THERMAL_PROTECTION_HOTENDS
#undef PREVENT_COLD_EXTRUSION
#undef PREVENT_LENGTHY_EXTRUDE #undef PREVENT_LENGTHY_EXTRUDE
#undef FILAMENT_RUNOUT_SENSOR #undef FILAMENT_RUNOUT_SENSOR
#undef FILAMENT_RUNOUT_DISTANCE_MM #undef FILAMENT_RUNOUT_DISTANCE_MM
@@ -657,9 +655,6 @@
#else #else
#define E_STEPPERS 1 #define E_STEPPERS 1
#endif #endif
#if !HAS_SWITCHING_NOZZLE
#define HOTENDS E_STEPPERS
#endif
#elif ENABLED(MIXING_EXTRUDER) // Multiple feeds are mixed proportionally #elif ENABLED(MIXING_EXTRUDER) // Multiple feeds are mixed proportionally
@@ -691,16 +686,7 @@
#define SINGLENOZZLE #define SINGLENOZZLE
#endif #endif
#if EITHER(SINGLENOZZLE, MIXING_EXTRUDER) // One hotend, one thermistor, no XY offset // Default E steppers / manual motion is one per extruder
#undef HOTENDS
#define HOTENDS 1
#undef HOTEND_OFFSET_X
#undef HOTEND_OFFSET_Y
#endif
#ifndef HOTENDS
#define HOTENDS EXTRUDERS
#endif
#ifndef E_STEPPERS #ifndef E_STEPPERS
#define E_STEPPERS EXTRUDERS #define E_STEPPERS EXTRUDERS
#endif #endif
@@ -708,6 +694,45 @@
#define E_MANUAL EXTRUDERS #define E_MANUAL EXTRUDERS
#endif #endif
// Number of hotends...
#if EITHER(SINGLENOZZLE, MIXING_EXTRUDER) // Only one for singlenozzle or mixing extruder
#define HOTENDS 1
#elif HAS_SWITCHING_EXTRUDER && !HAS_SWITCHING_NOZZLE // One for each pair of abstract "extruders"
#define HOTENDS E_STEPPERS
#elif TEMP_SENSOR_0
#define HOTENDS EXTRUDERS // One per extruder if at least one heater exists
#else
#define HOTENDS 0 // A machine with no hotends at all can still extrude
#endif
// More than one hotend...
#if HOTENDS > 1
#define HAS_MULTI_HOTEND 1
#define HAS_HOTEND_OFFSET 1
#ifndef HOTEND_OFFSET_X
#define HOTEND_OFFSET_X { 0 } // X offsets for each extruder
#endif
#ifndef HOTEND_OFFSET_Y
#define HOTEND_OFFSET_Y { 0 } // Y offsets for each extruder
#endif
#ifndef HOTEND_OFFSET_Z
#define HOTEND_OFFSET_Z { 0 } // Z offsets for each extruder
#endif
#else
#undef HOTEND_OFFSET_X
#undef HOTEND_OFFSET_Y
#undef HOTEND_OFFSET_Z
#endif
// At least one hotend...
#if HOTENDS
#define HAS_HOTEND 1
#ifndef HOTEND_OVERSHOOT
#define HOTEND_OVERSHOOT 15
#endif
#endif
// Clean up E-stepper-based settings...
#if E_STEPPERS <= 7 #if E_STEPPERS <= 7
#undef INVERT_E7_DIR #undef INVERT_E7_DIR
#undef E7_DRIVER_TYPE #undef E7_DRIVER_TYPE
@@ -1037,19 +1062,6 @@
#define E_INDEX_N(E) 0 #define E_INDEX_N(E) 0
#endif #endif
#if HOTENDS
#define HAS_HOTEND 1
#ifndef HOTEND_OVERSHOOT
#define HOTEND_OVERSHOOT 15
#endif
#if HOTENDS > 1
#define HAS_MULTI_HOTEND 1
#define HAS_HOTEND_OFFSET 1
#endif
#else
#undef PID_PARAMS_PER_HOTEND
#endif
// Helper macros for extruder and hotend arrays // Helper macros for extruder and hotend arrays
#define _EXTRUDER_LOOP(E) for (int8_t E = 0; E < EXTRUDERS; E++) #define _EXTRUDER_LOOP(E) for (int8_t E = 0; E < EXTRUDERS; E++)
#define EXTRUDER_LOOP() _EXTRUDER_LOOP(e) #define EXTRUDER_LOOP() _EXTRUDER_LOOP(e)
@@ -1061,21 +1073,6 @@
#define ARRAY_BY_HOTENDS(V...) ARRAY_N(HOTENDS, V) #define ARRAY_BY_HOTENDS(V...) ARRAY_N(HOTENDS, V)
#define ARRAY_BY_HOTENDS1(v1) ARRAY_N_1(HOTENDS, v1) #define ARRAY_BY_HOTENDS1(v1) ARRAY_N_1(HOTENDS, v1)
/**
* Default hotend offsets, if not defined
*/
#if HAS_HOTEND_OFFSET
#ifndef HOTEND_OFFSET_X
#define HOTEND_OFFSET_X { 0 } // X offsets for each extruder
#endif
#ifndef HOTEND_OFFSET_Y
#define HOTEND_OFFSET_Y { 0 } // Y offsets for each extruder
#endif
#ifndef HOTEND_OFFSET_Z
#define HOTEND_OFFSET_Z { 0 } // Z offsets for each extruder
#endif
#endif
/** /**
* Disable unused SINGLENOZZLE sub-options * Disable unused SINGLENOZZLE sub-options
*/ */

View File

@@ -184,7 +184,6 @@
#if !HAS_EXTRUDERS #if !HAS_EXTRUDERS
#define NO_VOLUMETRICS #define NO_VOLUMETRICS
#undef ADVANCED_PAUSE_FEATURE #undef ADVANCED_PAUSE_FEATURE
#undef AUTOTEMP
#undef DISABLE_IDLE_E #undef DISABLE_IDLE_E
#undef EXTRUDER_RUNOUT_PREVENT #undef EXTRUDER_RUNOUT_PREVENT
#undef FILAMENT_LOAD_UNLOAD_GCODES #undef FILAMENT_LOAD_UNLOAD_GCODES
@@ -193,11 +192,8 @@
#undef LIN_ADVANCE #undef LIN_ADVANCE
#undef MANUAL_E_MOVES_RELATIVE #undef MANUAL_E_MOVES_RELATIVE
#undef PID_EXTRUSION_SCALING #undef PID_EXTRUSION_SCALING
#undef PIDTEMP
#undef SHOW_TEMP_ADC_VALUES #undef SHOW_TEMP_ADC_VALUES
#undef STEALTHCHOP_E #undef STEALTHCHOP_E
#undef THERMAL_PROTECTION_PERIOD
#undef WATCH_TEMP_PERIOD
#endif #endif
#if ENABLED(DISABLE_X) && !defined(DISABLE_IDLE_X) #if ENABLED(DISABLE_X) && !defined(DISABLE_IDLE_X)
@@ -237,22 +233,47 @@
#endif #endif
#undef _OR_HAS_DI #undef _OR_HAS_DI
#if HOTENDS <= 7 // Remove hotend-dependent settings
#if HOTENDS < 8
#undef E7_AUTO_FAN_PIN #undef E7_AUTO_FAN_PIN
#if HOTENDS <= 6 #undef HEATER_7_MAXTEMP
#undef HEATER_7_MINTEMP
#if HOTENDS < 7
#undef E6_AUTO_FAN_PIN #undef E6_AUTO_FAN_PIN
#if HOTENDS <= 5 #undef HEATER_6_MAXTEMP
#undef HEATER_6_MINTEMP
#if HOTENDS < 6
#undef E5_AUTO_FAN_PIN #undef E5_AUTO_FAN_PIN
#if HOTENDS <= 4 #undef HEATER_5_MAXTEMP
#undef HEATER_5_MINTEMP
#if HOTENDS < 5
#undef E4_AUTO_FAN_PIN #undef E4_AUTO_FAN_PIN
#if HOTENDS <= 3 #undef HEATER_4_MAXTEMP
#undef HEATER_4_MINTEMP
#if HOTENDS < 4
#undef E3_AUTO_FAN_PIN #undef E3_AUTO_FAN_PIN
#if HOTENDS <= 2 #undef HEATER_3_MAXTEMP
#undef HEATER_3_MINTEMP
#if HOTENDS < 3
#undef E2_AUTO_FAN_PIN #undef E2_AUTO_FAN_PIN
#if HOTENDS <= 1 #undef HEATER_2_MAXTEMP
#undef HEATER_2_MINTEMP
#if HOTENDS < 2
#undef E1_AUTO_FAN_PIN #undef E1_AUTO_FAN_PIN
#if HOTENDS == 0 #undef HEATER_1_MAXTEMP
#undef HEATER_1_MINTEMP
#if HOTENDS < 1
#undef AUTOTEMP
#undef E0_AUTO_FAN_PIN #undef E0_AUTO_FAN_PIN
#undef HEATER_0_MAXTEMP
#undef HEATER_0_MINTEMP
#undef PID_PARAMS_PER_HOTEND
#undef PIDTEMP
#undef MPCTEMP
#undef PREVENT_COLD_EXTRUSION
#undef THERMAL_PROTECTION_HOTENDS
#undef THERMAL_PROTECTION_PERIOD
#undef WATCH_TEMP_PERIOD
#endif #endif
#endif #endif
#endif #endif
@@ -325,15 +346,13 @@
#define TEMP_SENSOR_0_IS_AD8495 1 #define TEMP_SENSOR_0_IS_AD8495 1
#elif TEMP_SENSOR_0 == -1 #elif TEMP_SENSOR_0 == -1
#define TEMP_SENSOR_0_IS_AD595 1 #define TEMP_SENSOR_0_IS_AD595 1
#elif TEMP_SENSOR_0 == 1000
#define TEMP_SENSOR_0_IS_CUSTOM 1
#elif TEMP_SENSOR_0 == 998 || TEMP_SENSOR_0 == 999 #elif TEMP_SENSOR_0 == 998 || TEMP_SENSOR_0 == 999
#define TEMP_SENSOR_0_IS_DUMMY 1 #define TEMP_SENSOR_0_IS_DUMMY 1
#elif TEMP_SENSOR_0 > 0 #elif TEMP_SENSOR_0 > 0
#define TEMP_SENSOR_0_IS_THERMISTOR 1 #define TEMP_SENSOR_0_IS_THERMISTOR 1
#else #if TEMP_SENSOR_0 == 1000
#undef HEATER_0_MINTEMP #define TEMP_SENSOR_0_IS_CUSTOM 1
#undef HEATER_0_MAXTEMP #endif
#endif #endif
#if TEMP_SENSOR_IS_MAX_TC(1) #if TEMP_SENSOR_IS_MAX_TC(1)
@@ -370,15 +389,13 @@
#define TEMP_SENSOR_1_IS_AD8495 1 #define TEMP_SENSOR_1_IS_AD8495 1
#elif TEMP_SENSOR_1 == -1 #elif TEMP_SENSOR_1 == -1
#define TEMP_SENSOR_1_IS_AD595 1 #define TEMP_SENSOR_1_IS_AD595 1
#elif TEMP_SENSOR_1 == 1000
#define TEMP_SENSOR_1_IS_CUSTOM 1
#elif TEMP_SENSOR_1 == 998 || TEMP_SENSOR_1 == 999 #elif TEMP_SENSOR_1 == 998 || TEMP_SENSOR_1 == 999
#define TEMP_SENSOR_1_IS_DUMMY 1 #define TEMP_SENSOR_1_IS_DUMMY 1
#elif TEMP_SENSOR_1 > 0 #elif TEMP_SENSOR_1 > 0
#define TEMP_SENSOR_1_IS_THERMISTOR 1 #define TEMP_SENSOR_1_IS_THERMISTOR 1
#else #if TEMP_SENSOR_1 == 1000
#undef HEATER_1_MINTEMP #define TEMP_SENSOR_1_IS_CUSTOM 1
#undef HEATER_1_MAXTEMP #endif
#endif #endif
#if TEMP_SENSOR_IS_MAX_TC(2) #if TEMP_SENSOR_IS_MAX_TC(2)
@@ -415,70 +432,58 @@
#define TEMP_SENSOR_2_IS_AD8495 1 #define TEMP_SENSOR_2_IS_AD8495 1
#elif TEMP_SENSOR_2 == -1 #elif TEMP_SENSOR_2 == -1
#define TEMP_SENSOR_2_IS_AD595 1 #define TEMP_SENSOR_2_IS_AD595 1
#elif TEMP_SENSOR_2 == 1000
#define TEMP_SENSOR_2_IS_CUSTOM 1
#elif TEMP_SENSOR_2 == 998 || TEMP_SENSOR_2 == 999 #elif TEMP_SENSOR_2 == 998 || TEMP_SENSOR_2 == 999
#define TEMP_SENSOR_2_IS_DUMMY 1 #define TEMP_SENSOR_2_IS_DUMMY 1
#elif TEMP_SENSOR_2 > 0 #elif TEMP_SENSOR_2 > 0
#define TEMP_SENSOR_2_IS_THERMISTOR 1 #define TEMP_SENSOR_2_IS_THERMISTOR 1
#else #if TEMP_SENSOR_2 == 1000
#undef HEATER_2_MINTEMP #define TEMP_SENSOR_2_IS_CUSTOM 1
#undef HEATER_2_MAXTEMP #endif
#endif #endif
#if TEMP_SENSOR_3 == 1000 #if TEMP_SENSOR_3 == 998 || TEMP_SENSOR_3 == 999
#define TEMP_SENSOR_3_IS_CUSTOM 1
#elif TEMP_SENSOR_3 == 998 || TEMP_SENSOR_3 == 999
#define TEMP_SENSOR_3_IS_DUMMY 1 #define TEMP_SENSOR_3_IS_DUMMY 1
#elif TEMP_SENSOR_3 > 0 #elif TEMP_SENSOR_3 > 0
#define TEMP_SENSOR_3_IS_THERMISTOR 1 #define TEMP_SENSOR_3_IS_THERMISTOR 1
#elif !TEMP_SENSOR_3 #if TEMP_SENSOR_3 == 1000
#undef HEATER_3_MINTEMP #define TEMP_SENSOR_3_IS_CUSTOM 1
#undef HEATER_3_MAXTEMP #endif
#endif #endif
#if TEMP_SENSOR_4 == 1000 #if TEMP_SENSOR_4 == 998 || TEMP_SENSOR_4 == 999
#define TEMP_SENSOR_4_IS_CUSTOM 1
#elif TEMP_SENSOR_4 == 998 || TEMP_SENSOR_4 == 999
#define TEMP_SENSOR_4_IS_DUMMY 1 #define TEMP_SENSOR_4_IS_DUMMY 1
#elif TEMP_SENSOR_4 > 0 #elif TEMP_SENSOR_4 > 0
#define TEMP_SENSOR_4_IS_THERMISTOR 1 #define TEMP_SENSOR_4_IS_THERMISTOR 1
#elif !TEMP_SENSOR_4 #if TEMP_SENSOR_4 == 1000
#undef HEATER_4_MINTEMP #define TEMP_SENSOR_4_IS_CUSTOM 1
#undef HEATER_4_MAXTEMP #endif
#endif #endif
#if TEMP_SENSOR_5 == 1000 #if TEMP_SENSOR_5 == 998 || TEMP_SENSOR_5 == 999
#define TEMP_SENSOR_5_IS_CUSTOM 1
#elif TEMP_SENSOR_5 == 998 || TEMP_SENSOR_5 == 999
#define TEMP_SENSOR_5_IS_DUMMY 1 #define TEMP_SENSOR_5_IS_DUMMY 1
#elif TEMP_SENSOR_5 > 0 #elif TEMP_SENSOR_5 > 0
#define TEMP_SENSOR_5_IS_THERMISTOR 1 #define TEMP_SENSOR_5_IS_THERMISTOR 1
#elif !TEMP_SENSOR_5 #if TEMP_SENSOR_5 == 1000
#undef HEATER_5_MINTEMP #define TEMP_SENSOR_5_IS_CUSTOM 1
#undef HEATER_5_MAXTEMP #endif
#endif #endif
#if TEMP_SENSOR_6 == 1000 #if TEMP_SENSOR_6 == 998 || TEMP_SENSOR_6 == 999
#define TEMP_SENSOR_6_IS_CUSTOM 1
#elif TEMP_SENSOR_6 == 998 || TEMP_SENSOR_6 == 999
#define TEMP_SENSOR_6_IS_DUMMY 1 #define TEMP_SENSOR_6_IS_DUMMY 1
#elif TEMP_SENSOR_6 > 0 #elif TEMP_SENSOR_6 > 0
#define TEMP_SENSOR_6_IS_THERMISTOR 1 #define TEMP_SENSOR_6_IS_THERMISTOR 1
#elif !TEMP_SENSOR_6 #if TEMP_SENSOR_6 == 1000
#undef HEATER_6_MINTEMP #define TEMP_SENSOR_6_IS_CUSTOM 1
#undef HEATER_6_MAXTEMP #endif
#endif #endif
#if TEMP_SENSOR_7 == 1000 #if TEMP_SENSOR_7 == 998 || TEMP_SENSOR_7 == 999
#define TEMP_SENSOR_7_IS_CUSTOM 1
#elif TEMP_SENSOR_7 == 998 || TEMP_SENSOR_7 == 999
#define TEMP_SENSOR_7_IS_DUMMY 1 #define TEMP_SENSOR_7_IS_DUMMY 1
#elif TEMP_SENSOR_7 > 0 #elif TEMP_SENSOR_7 > 0
#define TEMP_SENSOR_7_IS_THERMISTOR 1 #define TEMP_SENSOR_7_IS_THERMISTOR 1
#elif !TEMP_SENSOR_7 #if TEMP_SENSOR_7 == 1000
#undef HEATER_7_MINTEMP #define TEMP_SENSOR_7_IS_CUSTOM 1
#undef HEATER_7_MAXTEMP #endif
#endif #endif
#if TEMP_SENSOR_IS_MAX_TC(REDUNDANT) #if TEMP_SENSOR_IS_MAX_TC(REDUNDANT)
@@ -542,12 +547,12 @@
#define TEMP_SENSOR_REDUNDANT_IS_AD8495 1 #define TEMP_SENSOR_REDUNDANT_IS_AD8495 1
#elif TEMP_SENSOR_REDUNDANT == -1 #elif TEMP_SENSOR_REDUNDANT == -1
#define TEMP_SENSOR_REDUNDANT_IS_AD595 1 #define TEMP_SENSOR_REDUNDANT_IS_AD595 1
#elif TEMP_SENSOR_REDUNDANT == 998 || TEMP_SENSOR_REDUNDANT == 999
#error "Dummy sensors are not supported for TEMP_SENSOR_REDUNDANT."
#elif TEMP_SENSOR_REDUNDANT > 0 #elif TEMP_SENSOR_REDUNDANT > 0
#define TEMP_SENSOR_REDUNDANT_IS_THERMISTOR 1 #define TEMP_SENSOR_REDUNDANT_IS_THERMISTOR 1
#if TEMP_SENSOR_REDUNDANT == 1000 #if TEMP_SENSOR_REDUNDANT == 1000
#define TEMP_SENSOR_REDUNDANT_IS_CUSTOM 1 #define TEMP_SENSOR_REDUNDANT_IS_CUSTOM 1
#elif TEMP_SENSOR_REDUNDANT == 998 || TEMP_SENSOR_REDUNDANT == 999
#error "Dummy sensors are not supported for TEMP_SENSOR_REDUNDANT."
#endif #endif
#endif #endif
@@ -572,16 +577,13 @@
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_3." #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_3."
#elif TEMP_SENSOR_3 == -1 #elif TEMP_SENSOR_3 == -1
#define TEMP_SENSOR_3_IS_AD595 1 #define TEMP_SENSOR_3_IS_AD595 1
#elif TEMP_SENSOR_3 == 998 || TEMP_SENSOR_3 == 999
#define TEMP_SENSOR_3_IS_DUMMY 1
#elif TEMP_SENSOR_3 > 0 #elif TEMP_SENSOR_3 > 0
#define TEMP_SENSOR_3_IS_THERMISTOR 1 #define TEMP_SENSOR_3_IS_THERMISTOR 1
#if TEMP_SENSOR_3 == 1000 #if TEMP_SENSOR_3 == 1000
#define TEMP_SENSOR_3_IS_CUSTOM 1 #define TEMP_SENSOR_3_IS_CUSTOM 1
#elif TEMP_SENSOR_3 == 998 || TEMP_SENSOR_3 == 999
#define TEMP_SENSOR_3_IS_DUMMY 1
#endif #endif
#else
#undef HEATER_3_MINTEMP
#undef HEATER_3_MAXTEMP
#endif #endif
#if TEMP_SENSOR_4 == -4 #if TEMP_SENSOR_4 == -4
@@ -592,16 +594,13 @@
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_4." #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_4."
#elif TEMP_SENSOR_4 == -1 #elif TEMP_SENSOR_4 == -1
#define TEMP_SENSOR_4_IS_AD595 1 #define TEMP_SENSOR_4_IS_AD595 1
#elif TEMP_SENSOR_4 == 998 || TEMP_SENSOR_4 == 999
#define TEMP_SENSOR_4_IS_DUMMY 1
#elif TEMP_SENSOR_4 > 0 #elif TEMP_SENSOR_4 > 0
#define TEMP_SENSOR_4_IS_THERMISTOR 1 #define TEMP_SENSOR_4_IS_THERMISTOR 1
#if TEMP_SENSOR_4 == 1000 #if TEMP_SENSOR_4 == 1000
#define TEMP_SENSOR_4_IS_CUSTOM 1 #define TEMP_SENSOR_4_IS_CUSTOM 1
#elif TEMP_SENSOR_4 == 998 || TEMP_SENSOR_4 == 999
#define TEMP_SENSOR_4_IS_DUMMY 1
#endif #endif
#else
#undef HEATER_4_MINTEMP
#undef HEATER_4_MAXTEMP
#endif #endif
#if TEMP_SENSOR_5 == -4 #if TEMP_SENSOR_5 == -4
@@ -612,16 +611,13 @@
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_5." #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_5."
#elif TEMP_SENSOR_5 == -1 #elif TEMP_SENSOR_5 == -1
#define TEMP_SENSOR_5_IS_AD595 1 #define TEMP_SENSOR_5_IS_AD595 1
#elif TEMP_SENSOR_5 == 998 || TEMP_SENSOR_5 == 999
#define TEMP_SENSOR_5_IS_DUMMY 1
#elif TEMP_SENSOR_5 > 0 #elif TEMP_SENSOR_5 > 0
#define TEMP_SENSOR_5_IS_THERMISTOR 1 #define TEMP_SENSOR_5_IS_THERMISTOR 1
#if TEMP_SENSOR_5 == 1000 #if TEMP_SENSOR_5 == 1000
#define TEMP_SENSOR_5_IS_CUSTOM 1 #define TEMP_SENSOR_5_IS_CUSTOM 1
#elif TEMP_SENSOR_5 == 998 || TEMP_SENSOR_5 == 999
#define TEMP_SENSOR_5_IS_DUMMY 1
#endif #endif
#else
#undef HEATER_5_MINTEMP
#undef HEATER_5_MAXTEMP
#endif #endif
#if TEMP_SENSOR_6 == -4 #if TEMP_SENSOR_6 == -4
@@ -632,16 +628,13 @@
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_6." #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_6."
#elif TEMP_SENSOR_6 == -1 #elif TEMP_SENSOR_6 == -1
#define TEMP_SENSOR_6_IS_AD595 1 #define TEMP_SENSOR_6_IS_AD595 1
#elif TEMP_SENSOR_6 == 998 || TEMP_SENSOR_6 == 999
#define TEMP_SENSOR_6_IS_DUMMY 1
#elif TEMP_SENSOR_6 > 0 #elif TEMP_SENSOR_6 > 0
#define TEMP_SENSOR_6_IS_THERMISTOR 1 #define TEMP_SENSOR_6_IS_THERMISTOR 1
#if TEMP_SENSOR_6 == 1000 #if TEMP_SENSOR_6 == 1000
#define TEMP_SENSOR_6_IS_CUSTOM 1 #define TEMP_SENSOR_6_IS_CUSTOM 1
#elif TEMP_SENSOR_6 == 998 || TEMP_SENSOR_6 == 999
#define TEMP_SENSOR_6_IS_DUMMY 1
#endif #endif
#else
#undef HEATER_6_MINTEMP
#undef HEATER_6_MAXTEMP
#endif #endif
#if TEMP_SENSOR_7 == -4 #if TEMP_SENSOR_7 == -4
@@ -652,16 +645,13 @@
#error "MAX7775 Thermocouples (-2) not supported for TEMP_SENSOR_7." #error "MAX7775 Thermocouples (-2) not supported for TEMP_SENSOR_7."
#elif TEMP_SENSOR_7 == -1 #elif TEMP_SENSOR_7 == -1
#define TEMP_SENSOR_7_IS_AD595 1 #define TEMP_SENSOR_7_IS_AD595 1
#elif TEMP_SENSOR_7 == 998 || TEMP_SENSOR_7 == 999
#define TEMP_SENSOR_7_IS_DUMMY 1
#elif TEMP_SENSOR_7 > 0 #elif TEMP_SENSOR_7 > 0
#define TEMP_SENSOR_7_IS_THERMISTOR 1 #define TEMP_SENSOR_7_IS_THERMISTOR 1
#if TEMP_SENSOR_7 == 1000 #if TEMP_SENSOR_7 == 1000
#define TEMP_SENSOR_7_IS_CUSTOM 1 #define TEMP_SENSOR_7_IS_CUSTOM 1
#elif TEMP_SENSOR_7 == 998 || TEMP_SENSOR_7 == 999
#define TEMP_SENSOR_7_IS_DUMMY 1
#endif #endif
#else
#undef HEATER_7_MINTEMP
#undef HEATER_7_MAXTEMP
#endif #endif
#if TEMP_SENSOR_BED == -4 #if TEMP_SENSOR_BED == -4
@@ -672,12 +662,12 @@
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_BED." #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_BED."
#elif TEMP_SENSOR_BED == -1 #elif TEMP_SENSOR_BED == -1
#define TEMP_SENSOR_BED_IS_AD595 1 #define TEMP_SENSOR_BED_IS_AD595 1
#elif TEMP_SENSOR_BED == 998 || TEMP_SENSOR_BED == 999
#define TEMP_SENSOR_BED_IS_DUMMY 1
#elif TEMP_SENSOR_BED > 0 #elif TEMP_SENSOR_BED > 0
#define TEMP_SENSOR_BED_IS_THERMISTOR 1 #define TEMP_SENSOR_BED_IS_THERMISTOR 1
#if TEMP_SENSOR_BED == 1000 #if TEMP_SENSOR_BED == 1000
#define TEMP_SENSOR_BED_IS_CUSTOM 1 #define TEMP_SENSOR_BED_IS_CUSTOM 1
#elif TEMP_SENSOR_BED == 998 || TEMP_SENSOR_BED == 999
#define TEMP_SENSOR_BED_IS_DUMMY 1
#endif #endif
#else #else
#undef THERMAL_PROTECTION_BED #undef THERMAL_PROTECTION_BED
@@ -694,12 +684,12 @@
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_CHAMBER." #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_CHAMBER."
#elif TEMP_SENSOR_CHAMBER == -1 #elif TEMP_SENSOR_CHAMBER == -1
#define TEMP_SENSOR_CHAMBER_IS_AD595 1 #define TEMP_SENSOR_CHAMBER_IS_AD595 1
#elif TEMP_SENSOR_CHAMBER == 998 || TEMP_SENSOR_CHAMBER == 999
#define TEMP_SENSOR_CHAMBER_IS_DUMMY 1
#elif TEMP_SENSOR_CHAMBER > 0 #elif TEMP_SENSOR_CHAMBER > 0
#define TEMP_SENSOR_CHAMBER_IS_THERMISTOR 1 #define TEMP_SENSOR_CHAMBER_IS_THERMISTOR 1
#if TEMP_SENSOR_CHAMBER == 1000 #if TEMP_SENSOR_CHAMBER == 1000
#define TEMP_SENSOR_CHAMBER_IS_CUSTOM 1 #define TEMP_SENSOR_CHAMBER_IS_CUSTOM 1
#elif TEMP_SENSOR_CHAMBER == 998 || TEMP_SENSOR_CHAMBER == 999
#define TEMP_SENSOR_CHAMBER_IS_DUMMY 1
#endif #endif
#else #else
#undef THERMAL_PROTECTION_CHAMBER #undef THERMAL_PROTECTION_CHAMBER
@@ -715,12 +705,12 @@
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_COOLER." #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_COOLER."
#elif TEMP_SENSOR_COOLER == -1 #elif TEMP_SENSOR_COOLER == -1
#define TEMP_SENSOR_COOLER_IS_AD595 1 #define TEMP_SENSOR_COOLER_IS_AD595 1
#elif TEMP_SENSOR_COOLER == 998 || TEMP_SENSOR_COOLER == 999
#define TEMP_SENSOR_COOLER_IS_DUMMY 1
#elif TEMP_SENSOR_COOLER > 0 #elif TEMP_SENSOR_COOLER > 0
#define TEMP_SENSOR_COOLER_IS_THERMISTOR 1 #define TEMP_SENSOR_COOLER_IS_THERMISTOR 1
#if TEMP_SENSOR_COOLER == 1000 #if TEMP_SENSOR_COOLER == 1000
#define TEMP_SENSOR_COOLER_IS_CUSTOM 1 #define TEMP_SENSOR_COOLER_IS_CUSTOM 1
#elif TEMP_SENSOR_COOLER == 998 || TEMP_SENSOR_COOLER == 999
#define TEMP_SENSOR_COOLER_IS_DUMMY 1
#endif #endif
#else #else
#undef THERMAL_PROTECTION_COOLER #undef THERMAL_PROTECTION_COOLER
@@ -736,12 +726,12 @@
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_PROBE." #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_PROBE."
#elif TEMP_SENSOR_PROBE == -1 #elif TEMP_SENSOR_PROBE == -1
#define TEMP_SENSOR_PROBE_IS_AD595 1 #define TEMP_SENSOR_PROBE_IS_AD595 1
#elif TEMP_SENSOR_PROBE == 998 || TEMP_SENSOR_PROBE == 999
#define TEMP_SENSOR_PROBE_IS_DUMMY 1
#elif TEMP_SENSOR_PROBE > 0 #elif TEMP_SENSOR_PROBE > 0
#define TEMP_SENSOR_PROBE_IS_THERMISTOR 1 #define TEMP_SENSOR_PROBE_IS_THERMISTOR 1
#if TEMP_SENSOR_PROBE == 1000 #if TEMP_SENSOR_PROBE == 1000
#define TEMP_SENSOR_PROBE_IS_CUSTOM 1 #define TEMP_SENSOR_PROBE_IS_CUSTOM 1
#elif TEMP_SENSOR_PROBE == 998 || TEMP_SENSOR_PROBE == 999
#define TEMP_SENSOR_PROBE_IS_DUMMY 1
#endif #endif
#endif #endif
@@ -753,12 +743,12 @@
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_BOARD." #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_BOARD."
#elif TEMP_SENSOR_BOARD == -1 #elif TEMP_SENSOR_BOARD == -1
#define TEMP_SENSOR_BOARD_IS_AD595 1 #define TEMP_SENSOR_BOARD_IS_AD595 1
#elif TEMP_SENSOR_BOARD == 998 || TEMP_SENSOR_BOARD == 999
#define TEMP_SENSOR_BOARD_IS_DUMMY 1
#elif TEMP_SENSOR_BOARD > 0 #elif TEMP_SENSOR_BOARD > 0
#define TEMP_SENSOR_BOARD_IS_THERMISTOR 1 #define TEMP_SENSOR_BOARD_IS_THERMISTOR 1
#if TEMP_SENSOR_BOARD == 1000 #if TEMP_SENSOR_BOARD == 1000
#define TEMP_SENSOR_BOARD_IS_CUSTOM 1 #define TEMP_SENSOR_BOARD_IS_CUSTOM 1
#elif TEMP_SENSOR_BOARD == 998 || TEMP_SENSOR_BOARD == 999
#define TEMP_SENSOR_BOARD_IS_DUMMY 1
#endif #endif
#endif #endif

View File

@@ -2628,84 +2628,85 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
#endif #endif
/** /**
* Test Sensor & Heater pin combos.
* Pins and Sensor IDs must be set for each heater * Pins and Sensor IDs must be set for each heater
*/ */
#if HAS_EXTRUDERS && !ANY_PIN(TEMP_0, TEMP_0_CS) #if HAS_HOTEND
#error "TEMP_0_PIN or TEMP_0_CS_PIN not defined for this board." #if !HAS_HEATER_0
#elif HAS_EXTRUDERS && !HAS_HEATER_0 #error "HEATER_0_PIN not defined for this board."
#error "HEATER_0_PIN not defined for this board." #elif TEMP_SENSOR_IS_MAX_TC(0) && !PIN_EXISTS(TEMP_0_CS)
#elif TEMP_SENSOR_IS_MAX_TC(0) && !PIN_EXISTS(TEMP_0_CS) #error "TEMP_SENSOR_0 MAX thermocouple requires TEMP_0_CS_PIN."
#error "TEMP_SENSOR_0 MAX thermocouple requires TEMP_0_CS_PIN." #elif TEMP_SENSOR_0 == 0
#elif HAS_HOTEND && !HAS_TEMP_HOTEND && !TEMP_SENSOR_0_IS_DUMMY #error "TEMP_SENSOR_0 is required with 1 or more HOTENDS."
#error "TEMP_0_PIN (required for TEMP_SENSOR_0) not defined for this board." #elif !ANY_PIN(TEMP_0, TEMP_0_CS) && !TEMP_SENSOR_0_IS_DUMMY
#elif EITHER(HAS_MULTI_HOTEND, HEATERS_PARALLEL) && !HAS_HEATER_1 #error "TEMP_0_PIN or TEMP_0_CS_PIN not defined for this board."
#error "HEATER_1_PIN is not defined. TEMP_SENSOR_1 might not be set, or the board (not EEB / EEF?) doesn't define a pin."
#endif
#if HAS_MULTI_HOTEND
#if TEMP_SENSOR_IS_MAX_TC(1) && !PIN_EXISTS(TEMP_1_CS)
#error "TEMP_SENSOR_1 MAX thermocouple requires TEMP_1_CS_PIN."
#elif TEMP_SENSOR_1 == 0
#error "TEMP_SENSOR_1 is required with 2 or more HOTENDS."
#elif !ANY_PIN(TEMP_1, TEMP_1_CS) && !TEMP_SENSOR_1_IS_DUMMY
#error "TEMP_1_PIN or TEMP_1_CS_PIN not defined for this board."
#endif #endif
#if HOTENDS > 2 #if EITHER(HAS_MULTI_HOTEND, HEATERS_PARALLEL) && !HAS_HEATER_1
#if TEMP_SENSOR_2 == 0 #error "HEATER_1_PIN is not defined. TEMP_SENSOR_1 might not be set, or the board (not EEB / EEF?) doesn't define a pin."
#error "TEMP_SENSOR_2 is required with 3 or more HOTENDS." #endif
#elif !HAS_HEATER_2 #if HAS_MULTI_HOTEND
#error "HEATER_2_PIN not defined for this board." #if TEMP_SENSOR_IS_MAX_TC(1) && !PIN_EXISTS(TEMP_1_CS)
#elif !ANY_PIN(TEMP_2, TEMP_2_CS) && !TEMP_SENSOR_2_IS_DUMMY #error "TEMP_SENSOR_1 MAX thermocouple requires TEMP_1_CS_PIN."
#error "TEMP_2_PIN or TEMP_2_CS_PIN not defined for this board." #elif TEMP_SENSOR_1 == 0
#error "TEMP_SENSOR_1 is required with 2 or more HOTENDS."
#elif !ANY_PIN(TEMP_1, TEMP_1_CS) && !TEMP_SENSOR_1_IS_DUMMY
#error "TEMP_1_PIN or TEMP_1_CS_PIN not defined for this board."
#endif #endif
#if HOTENDS > 3 #if HOTENDS > 2
#if TEMP_SENSOR_3 == 0 #if TEMP_SENSOR_2 == 0
#error "TEMP_SENSOR_3 is required with 4 or more HOTENDS." #error "TEMP_SENSOR_2 is required with 3 or more HOTENDS."
#elif !HAS_HEATER_3 #elif !HAS_HEATER_2
#error "HEATER_3_PIN not defined for this board." #error "HEATER_2_PIN not defined for this board."
#elif !PIN_EXISTS(TEMP_3) && !TEMP_SENSOR_3_IS_DUMMY #elif !ANY_PIN(TEMP_2, TEMP_2_CS) && !TEMP_SENSOR_2_IS_DUMMY
#error "TEMP_3_PIN not defined for this board." #error "TEMP_2_PIN or TEMP_2_CS_PIN not defined for this board."
#endif #endif
#if HOTENDS > 4 #if HOTENDS > 3
#if TEMP_SENSOR_4 == 0 #if TEMP_SENSOR_3 == 0
#error "TEMP_SENSOR_4 is required with 5 or more HOTENDS." #error "TEMP_SENSOR_3 is required with 4 or more HOTENDS."
#elif !HAS_HEATER_4 #elif !HAS_HEATER_3
#error "HEATER_4_PIN not defined for this board." #error "HEATER_3_PIN not defined for this board."
#elif !PIN_EXISTS(TEMP_4) && !TEMP_SENSOR_4_IS_DUMMY #elif !PIN_EXISTS(TEMP_3) && !TEMP_SENSOR_3_IS_DUMMY
#error "TEMP_4_PIN not defined for this board." #error "TEMP_3_PIN not defined for this board."
#endif #endif
#if HOTENDS > 5 #if HOTENDS > 4
#if TEMP_SENSOR_5 == 0 #if TEMP_SENSOR_4 == 0
#error "TEMP_SENSOR_5 is required with 6 HOTENDS." #error "TEMP_SENSOR_4 is required with 5 or more HOTENDS."
#elif !HAS_HEATER_5 #elif !HAS_HEATER_4
#error "HEATER_5_PIN not defined for this board." #error "HEATER_4_PIN not defined for this board."
#elif !PIN_EXISTS(TEMP_5) && !TEMP_SENSOR_5_IS_DUMMY #elif !PIN_EXISTS(TEMP_4) && !TEMP_SENSOR_4_IS_DUMMY
#error "TEMP_5_PIN not defined for this board." #error "TEMP_4_PIN not defined for this board."
#endif #endif
#if HOTENDS > 6 #if HOTENDS > 5
#if TEMP_SENSOR_6 == 0 #if TEMP_SENSOR_5 == 0
#error "TEMP_SENSOR_6 is required with 6 HOTENDS." #error "TEMP_SENSOR_5 is required with 6 HOTENDS."
#elif !HAS_HEATER_6 #elif !HAS_HEATER_5
#error "HEATER_6_PIN not defined for this board." #error "HEATER_5_PIN not defined for this board."
#elif !PIN_EXISTS(TEMP_6) && !TEMP_SENSOR_6_IS_DUMMY #elif !PIN_EXISTS(TEMP_5) && !TEMP_SENSOR_5_IS_DUMMY
#error "TEMP_6_PIN not defined for this board." #error "TEMP_5_PIN not defined for this board."
#endif #endif
#if HOTENDS > 7 #if HOTENDS > 6
#if TEMP_SENSOR_7 == 0 #if TEMP_SENSOR_6 == 0
#error "TEMP_SENSOR_7 is required with 7 HOTENDS." #error "TEMP_SENSOR_6 is required with 6 HOTENDS."
#elif !HAS_HEATER_7 #elif !HAS_HEATER_6
#error "HEATER_7_PIN not defined for this board." #error "HEATER_6_PIN not defined for this board."
#elif !PIN_EXISTS(TEMP_7) && !TEMP_SENSOR_7_IS_DUMMY #elif !PIN_EXISTS(TEMP_6) && !TEMP_SENSOR_6_IS_DUMMY
#error "TEMP_7_PIN not defined for this board." #error "TEMP_6_PIN not defined for this board."
#endif #endif
#endif // HOTENDS > 7 #if HOTENDS > 7
#endif // HOTENDS > 6 #if TEMP_SENSOR_7 == 0
#endif // HOTENDS > 5 #error "TEMP_SENSOR_7 is required with 7 HOTENDS."
#endif // HOTENDS > 4 #elif !HAS_HEATER_7
#endif // HOTENDS > 3 #error "HEATER_7_PIN not defined for this board."
#endif // HOTENDS > 2 #elif !PIN_EXISTS(TEMP_7) && !TEMP_SENSOR_7_IS_DUMMY
#endif // HAS_MULTI_HOTEND #error "TEMP_7_PIN not defined for this board."
#endif
#endif // HOTENDS > 7
#endif // HOTENDS > 6
#endif // HOTENDS > 5
#endif // HOTENDS > 4
#endif // HOTENDS > 3
#endif // HOTENDS > 2
#endif // HAS_MULTI_HOTEND
#endif // HAS_HOTEND
#if DO_TOOLCHANGE_FOR_PROBING && PROBING_TOOL >= EXTRUDERS #if DO_TOOLCHANGE_FOR_PROBING && PROBING_TOOL >= EXTRUDERS
#error "PROBING_TOOL must be a valid tool index." #error "PROBING_TOOL must be a valid tool index."
@@ -2836,8 +2837,8 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
#error "E0_STEP_PIN or E0_DIR_PIN not defined for this board." #error "E0_STEP_PIN or E0_DIR_PIN not defined for this board."
#elif ( !(defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PINS_EXIST(E0_STEP, E0_DIR) || !HAS_E0_ENABLE)) #elif ( !(defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PINS_EXIST(E0_STEP, E0_DIR) || !HAS_E0_ENABLE))
#error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board." #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
#elif EXTRUDERS && TEMP_SENSOR_0 == 0 #elif HOTENDS && TEMP_SENSOR_0 == 0
#error "TEMP_SENSOR_0 is required if there are any extruders." #error "TEMP_SENSOR_0 is required if there are any hotends."
#endif #endif
#endif #endif

View File

@@ -2785,7 +2785,7 @@ void Temperature::init() {
temp_range[NR].raw_max -= TEMPDIR(NR) * (OVERSAMPLENR); \ temp_range[NR].raw_max -= TEMPDIR(NR) * (OVERSAMPLENR); \
}while(0) }while(0)
#define _MINMAX_TEST(N,M) (HOTENDS > N && TEMP_SENSOR(N) > 0 && TEMP_SENSOR(N) != 998 && TEMP_SENSOR(N) != 999 && defined(HEATER_##N##_##M##TEMP)) #define _MINMAX_TEST(N,M) (HOTENDS > N && TEMP_SENSOR_##NR##_IS_THERMISTOR && defined(HEATER_##N##_##M##TEMP))
#if _MINMAX_TEST(0, MIN) #if _MINMAX_TEST(0, MIN)
_TEMP_MIN_E(0); _TEMP_MIN_E(0);