Fix: Thermal runaway if nonexistent bed's temp is set

This commit is contained in:
Scott Lahteine
2017-04-02 11:48:10 -05:00
parent deaad78df9
commit 699310d1d2
4 changed files with 21 additions and 24 deletions

View File

@ -113,12 +113,12 @@ class Temperature {
static volatile int babystepsTodo[3];
#endif
#if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0
#if WATCH_HOTENDS
static int watch_target_temp[HOTENDS];
static millis_t watch_heater_next_ms[HOTENDS];
#endif
#if ENABLED(THERMAL_PROTECTION_BED) && WATCH_BED_TEMP_PERIOD > 0
#if WATCH_THE_BED
static int watch_target_bed_temp;
static millis_t watch_bed_next_ms;
#endif
@ -306,11 +306,11 @@ class Temperature {
}
static float degTargetBed() { return target_temperature_bed; }
#if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0
#if WATCH_HOTENDS
static void start_watching_heater(uint8_t e = 0);
#endif
#if ENABLED(THERMAL_PROTECTION_BED) && WATCH_BED_TEMP_PERIOD > 0
#if WATCH_THE_BED
static void start_watching_bed();
#endif
@ -325,14 +325,14 @@ class Temperature {
start_preheat_time(HOTEND_INDEX);
#endif
target_temperature[HOTEND_INDEX] = celsius;
#if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0
#if WATCH_HOTENDS
start_watching_heater(HOTEND_INDEX);
#endif
}
static void setTargetBed(const float& celsius) {
target_temperature_bed = celsius;
#if ENABLED(THERMAL_PROTECTION_BED) && WATCH_BED_TEMP_PERIOD > 0
#if WATCH_THE_BED
start_watching_bed();
#endif
}