|
@@ -83,6 +83,17 @@ unsigned char soft_pwm_bed;
|
83
|
83
|
#ifdef FILAMENT_SENSOR
|
84
|
84
|
int current_raw_filwidth = 0; //Holds measured filament diameter - one extruder only
|
85
|
85
|
#endif
|
|
86
|
+#if defined (THERMAL_RUNAWAY_PROTECTION_PERIOD) && THERMAL_RUNAWAY_PROTECTION_PERIOD > 0
|
|
87
|
+void thermal_runaway_protection(int *state, unsigned long *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc);
|
|
88
|
+static int thermal_runaway_state_machine[4]; // = {0,0,0,0};
|
|
89
|
+static unsigned long thermal_runaway_timer[4]; // = {0,0,0,0};
|
|
90
|
+static bool thermal_runaway = false;
|
|
91
|
+#if TEMP_SENSOR_BED != 0
|
|
92
|
+ static int thermal_runaway_bed_state_machine;
|
|
93
|
+ static unsigned long thermal_runaway_bed_timer;
|
|
94
|
+#endif
|
|
95
|
+#endif
|
|
96
|
+
|
86
|
97
|
//===========================================================================
|
87
|
98
|
//=============================private variables============================
|
88
|
99
|
//===========================================================================
|
|
@@ -1100,8 +1111,8 @@ void disable_heater() {
|
1100
|
1111
|
}
|
1101
|
1112
|
|
1102
|
1113
|
#ifdef HEATER_0_USES_MAX6675
|
1103
|
|
- #define MAX6675_HEAT_INTERVAL 250
|
1104
|
|
- long max6675_previous_millis = MAX6675_HEAT_INTERVAL;
|
|
1114
|
+ #define MAX6675_HEAT_INTERVAL 250u
|
|
1115
|
+ unsigned long max6675_previous_millis = MAX6675_HEAT_INTERVAL;
|
1105
|
1116
|
int max6675_temp = 2000;
|
1106
|
1117
|
|
1107
|
1118
|
static int read_max6675() {
|