Enable WATCH_TEMP_PERIOD by default

This commit is contained in:
Scott Lahteine
2015-05-08 22:36:02 -07:00
parent deedb00c18
commit 54deb9eea3
15 changed files with 56 additions and 45 deletions

View File

@ -171,7 +171,7 @@ static float analog2tempBed(int raw);
static void updateTemperaturesFromRawValues();
#ifdef WATCH_TEMP_PERIOD
int watch_start_temp[EXTRUDERS] = { 0 };
int watch_target_temp[EXTRUDERS] = { 0 };
millis_t watch_heater_next_ms[EXTRUDERS] = { 0 };
#endif
@ -625,11 +625,12 @@ void manage_heater() {
// Is it time to check this extruder's heater?
if (watch_heater_next_ms[e] && ms > watch_heater_next_ms[e]) {
// Has it failed to increase enough?
if (degHotend(e) < watch_start_temp[e] + WATCH_TEMP_INCREASE) {
if (degHotend(e) < watch_target_temp[e]) {
// Stop!
_temp_error(e, MSG_HEATING_FAILED, MSG_HEATING_FAILED_LCD);
}
else {
// Only check once per M104/M109
watch_heater_next_ms[e] = 0;
}
}
@ -997,24 +998,24 @@ void tp_init() {
#endif //BED_MAXTEMP
}
/**
* Start Heating Sanity Check for hotends that are below
* their target temperature by a configurable margin.
* This is called when the temperature is set. (M104, M109)
*/
void setWatch() {
#ifdef WATCH_TEMP_PERIOD
millis_t ms = millis() + WATCH_TEMP_PERIOD;
for (int e = 0; e < EXTRUDERS; e++) {
if (degHotend(e) < degTargetHotend(e) - (WATCH_TEMP_INCREASE * 2)) {
watch_start_temp[e] = degHotend(e);
watch_heater_next_ms[e] = ms;
#ifdef WATCH_TEMP_PERIOD
/**
* Start Heating Sanity Check for hotends that are below
* their target temperature by a configurable margin.
* This is called when the temperature is set. (M104, M109)
*/
void start_watching_heaters() {
millis_t ms = millis() + WATCH_TEMP_PERIOD;
for (int e = 0; e < EXTRUDERS; e++) {
if (degHotend(e) < degTargetHotend(e) - (WATCH_TEMP_INCREASE * 2)) {
watch_target_temp[e] = degHotend(e) + WATCH_TEMP_INCREASE;
watch_heater_next_ms[e] = ms;
}
else
watch_heater_next_ms[e] = 0;
}
else
watch_heater_next_ms[e] = 0;
}
#endif
}
}
#endif
#if HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION