|
@ -46,7 +46,7 @@ |
|
|
|
|
|
|
|
|
// Element identifiers. Positive values are hotends. Negative values are other heaters or coolers.
|
|
|
// Element identifiers. Positive values are hotends. Negative values are other heaters or coolers.
|
|
|
typedef enum : int8_t { |
|
|
typedef enum : int8_t { |
|
|
INDEX_NONE = -6, |
|
|
H_NONE = -6, |
|
|
H_COOLER, H_PROBE, H_REDUNDANT, H_CHAMBER, H_BED, |
|
|
H_COOLER, H_PROBE, H_REDUNDANT, H_CHAMBER, H_BED, |
|
|
H_E0, H_E1, H_E2, H_E3, H_E4, H_E5, H_E6, H_E7 |
|
|
H_E0, H_E1, H_E2, H_E3, H_E4, H_E5, H_E6, H_E7 |
|
|
} heater_id_t; |
|
|
} heater_id_t; |
|
@ -395,21 +395,21 @@ class Temperature { |
|
|
} heater_idle_t; |
|
|
} heater_idle_t; |
|
|
|
|
|
|
|
|
// Indices and size for the heater_idle array
|
|
|
// Indices and size for the heater_idle array
|
|
|
#define _ENUM_FOR_E(N) IDLE_INDEX_E##N, |
|
|
enum IdleIndex : int8_t { |
|
|
enum IdleIndex : uint8_t { |
|
|
_II = -1 |
|
|
REPEAT(HOTENDS, _ENUM_FOR_E) |
|
|
|
|
|
#if ENABLED(HAS_HEATED_BED) |
|
|
#define _IDLE_INDEX_E(N) ,IDLE_INDEX_E##N |
|
|
IDLE_INDEX_BED, |
|
|
REPEAT(HOTENDS, _IDLE_INDEX_E) |
|
|
#endif |
|
|
#undef _IDLE_INDEX_E |
|
|
NR_HEATER_IDLE |
|
|
|
|
|
|
|
|
OPTARG(HAS_HEATED_BED, IDLE_INDEX_BED) |
|
|
|
|
|
|
|
|
|
|
|
, NR_HEATER_IDLE |
|
|
}; |
|
|
}; |
|
|
#undef _ENUM_FOR_E |
|
|
|
|
|
|
|
|
|
|
|
// Convert the given heater_id_t to idle array index
|
|
|
// Convert the given heater_id_t to idle array index
|
|
|
static inline IdleIndex idle_index_for_id(const int8_t heater_id) { |
|
|
static inline IdleIndex idle_index_for_id(const int8_t heater_id) { |
|
|
#if HAS_HEATED_BED |
|
|
TERN_(HAS_HEATED_BED, if (heater_id == H_BED) return IDLE_INDEX_BED); |
|
|
if (heater_id == H_BED) return IDLE_INDEX_BED; |
|
|
|
|
|
#endif |
|
|
|
|
|
return (IdleIndex)_MAX(heater_id, 0); |
|
|
return (IdleIndex)_MAX(heater_id, 0); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -672,9 +672,7 @@ class Temperature { |
|
|
|
|
|
|
|
|
#if HAS_TEMP_HOTEND |
|
|
#if HAS_TEMP_HOTEND |
|
|
static bool wait_for_hotend(const uint8_t target_extruder, const bool no_wait_for_cooling=true |
|
|
static bool wait_for_hotend(const uint8_t target_extruder, const bool no_wait_for_cooling=true |
|
|
#if G26_CLICK_CAN_CANCEL |
|
|
OPTARG(G26_CLICK_CAN_CANCEL, const bool click_to_cancel=false) |
|
|
, const bool click_to_cancel=false |
|
|
|
|
|
#endif |
|
|
|
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
#if ENABLED(WAIT_FOR_HOTEND) |
|
|
#if ENABLED(WAIT_FOR_HOTEND) |
|
@ -721,9 +719,7 @@ class Temperature { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
static bool wait_for_bed(const bool no_wait_for_cooling=true |
|
|
static bool wait_for_bed(const bool no_wait_for_cooling=true |
|
|
#if G26_CLICK_CAN_CANCEL |
|
|
OPTARG(G26_CLICK_CAN_CANCEL, const bool click_to_cancel=false) |
|
|
, const bool click_to_cancel=false |
|
|
|
|
|
#endif |
|
|
|
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
static void wait_for_bed_heating(); |
|
|
static void wait_for_bed_heating(); |
|
@ -859,9 +855,7 @@ class Temperature { |
|
|
|
|
|
|
|
|
#if HAS_TEMP_SENSOR |
|
|
#if HAS_TEMP_SENSOR |
|
|
static void print_heater_states(const uint8_t target_extruder |
|
|
static void print_heater_states(const uint8_t target_extruder |
|
|
#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) |
|
|
OPTARG(TEMP_SENSOR_1_AS_REDUNDANT, const bool include_r=false) |
|
|
, const bool include_r=false |
|
|
|
|
|
#endif |
|
|
|
|
|
); |
|
|
); |
|
|
#if ENABLED(AUTO_REPORT_TEMPERATURES) |
|
|
#if ENABLED(AUTO_REPORT_TEMPERATURES) |
|
|
struct AutoReportTemp { static void report(); }; |
|
|
struct AutoReportTemp { static void report(); }; |
|
@ -925,35 +919,24 @@ class Temperature { |
|
|
#if HAS_THERMAL_PROTECTION |
|
|
#if HAS_THERMAL_PROTECTION |
|
|
|
|
|
|
|
|
// Indices and size for the tr_state_machine array. One for each protected heater.
|
|
|
// Indices and size for the tr_state_machine array. One for each protected heater.
|
|
|
#define _ENUM_FOR_E(N) RUNAWAY_IND_E##N, |
|
|
enum RunawayIndex : int8_t { |
|
|
enum RunawayIndex : uint8_t { |
|
|
_RI = -1 |
|
|
#if ENABLED(THERMAL_PROTECTION_HOTENDS) |
|
|
#if ENABLED(THERMAL_PROTECTION_HOTENDS) |
|
|
REPEAT(HOTENDS, _ENUM_FOR_E) |
|
|
#define _RUNAWAY_IND_E(N) ,RUNAWAY_IND_E##N |
|
|
|
|
|
REPEAT(HOTENDS, _RUNAWAY_IND_E) |
|
|
|
|
|
#undef _RUNAWAY_IND_E |
|
|
#endif |
|
|
#endif |
|
|
#if ENABLED(HAS_THERMALLY_PROTECTED_BED) |
|
|
OPTARG(HAS_THERMALLY_PROTECTED_BED, RUNAWAY_IND_BED) |
|
|
RUNAWAY_IND_BED, |
|
|
OPTARG(THERMAL_PROTECTION_CHAMBER, RUNAWAY_IND_CHAMBER) |
|
|
#endif |
|
|
OPTARG(THERMAL_PROTECTION_COOLER, RUNAWAY_IND_COOLER) |
|
|
#if ENABLED(THERMAL_PROTECTION_CHAMBER) |
|
|
, NR_HEATER_RUNAWAY |
|
|
RUNAWAY_IND_CHAMBER, |
|
|
|
|
|
#endif |
|
|
|
|
|
#if ENABLED(THERMAL_PROTECTION_COOLER) |
|
|
|
|
|
RUNAWAY_IND_COOLER, |
|
|
|
|
|
#endif |
|
|
|
|
|
NR_HEATER_RUNAWAY |
|
|
|
|
|
}; |
|
|
}; |
|
|
#undef _ENUM_FOR_E |
|
|
|
|
|
|
|
|
|
|
|
// Convert the given heater_id_t to runaway state array index
|
|
|
// Convert the given heater_id_t to runaway state array index
|
|
|
static inline RunawayIndex runaway_index_for_id(const int8_t heater_id) { |
|
|
static inline RunawayIndex runaway_index_for_id(const int8_t heater_id) { |
|
|
#if HAS_THERMALLY_PROTECTED_CHAMBER |
|
|
TERN_(HAS_THERMALLY_PROTECTED_CHAMBER, if (heater_id == H_CHAMBER) return RUNAWAY_IND_CHAMBER); |
|
|
if (heater_id == H_CHAMBER) return RUNAWAY_IND_CHAMBER; |
|
|
TERN_(HAS_THERMALLY_PROTECTED_CHAMBER, if (heater_id == H_COOLER) return RUNAWAY_IND_COOLER); |
|
|
#endif |
|
|
TERN_(HAS_THERMALLY_PROTECTED_BED, if (heater_id == H_BED) return RUNAWAY_IND_BED); |
|
|
#if HAS_THERMALLY_PROTECTED_CHAMBER |
|
|
|
|
|
if (heater_id == H_COOLER) return RUNAWAY_IND_COOLER; |
|
|
|
|
|
#endif |
|
|
|
|
|
#if HAS_THERMALLY_PROTECTED_BED |
|
|
|
|
|
if (heater_id == H_BED) return RUNAWAY_IND_BED; |
|
|
|
|
|
#endif |
|
|
|
|
|
return (RunawayIndex)_MAX(heater_id, 0); |
|
|
return (RunawayIndex)_MAX(heater_id, 0); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|