Browse Source

Only watch the heater that was set

pull/1/head
Scott Lahteine 10 years ago
parent
commit
9b3d4380d3
  1. 4
      Marlin/Marlin_main.cpp
  2. 4
      Marlin/temperature.cpp
  3. 2
      Marlin/temperature.h
  4. 2
      Marlin/ultralcd.cpp

4
Marlin/Marlin_main.cpp

@ -3168,7 +3168,7 @@ inline void gcode_M104() {
#endif #endif
#ifdef WATCH_TEMP_PERIOD #ifdef WATCH_TEMP_PERIOD
start_watching_heaters(); start_watching_heater(target_extruder);
#endif #endif
} }
} }
@ -3282,7 +3282,7 @@ inline void gcode_M109() {
#endif #endif
#ifdef WATCH_TEMP_PERIOD #ifdef WATCH_TEMP_PERIOD
start_watching_heaters(); start_watching_heater(target_extruder);
#endif #endif
millis_t temp_ms = millis(); millis_t temp_ms = millis();

4
Marlin/temperature.cpp

@ -1005,9 +1005,8 @@ void tp_init() {
* their target temperature by a configurable margin. * their target temperature by a configurable margin.
* This is called when the temperature is set. (M104, M109) * This is called when the temperature is set. (M104, M109)
*/ */
void start_watching_heaters() { void start_watching_heater(int e) {
millis_t ms = millis() + 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)) { if (degHotend(e) < degTargetHotend(e) - (WATCH_TEMP_INCREASE * 2)) {
watch_target_temp[e] = degHotend(e) + WATCH_TEMP_INCREASE; watch_target_temp[e] = degHotend(e) + WATCH_TEMP_INCREASE;
watch_heater_next_ms[e] = ms; watch_heater_next_ms[e] = ms;
@ -1015,7 +1014,6 @@ void tp_init() {
else else
watch_heater_next_ms[e] = 0; watch_heater_next_ms[e] = 0;
} }
}
#endif #endif
#if HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION #if HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION

2
Marlin/temperature.h

@ -138,7 +138,7 @@ void setExtruderAutoFanState(int pin, bool state);
void checkExtruderAutoFans(); void checkExtruderAutoFans();
#ifdef WATCH_TEMP_PERIOD #ifdef WATCH_TEMP_PERIOD
void start_watching_heaters(); void start_watching_heater(int e=0);
#endif #endif
FORCE_INLINE void autotempShutdown() { FORCE_INLINE void autotempShutdown() {

2
Marlin/ultralcd.cpp

@ -522,7 +522,7 @@ void _lcd_preheat(int endnum, const float temph, const float tempb, const int fa
fanSpeed = fan; fanSpeed = fan;
lcd_return_to_status(); lcd_return_to_status();
#ifdef WATCH_TEMP_PERIOD #ifdef WATCH_TEMP_PERIOD
start_watching_heaters(); if (endnum >= 0) start_watching_heater(endnum);
#endif #endif
} }
void lcd_preheat_pla0() { _lcd_preheat(0, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); } void lcd_preheat_pla0() { _lcd_preheat(0, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); }

Loading…
Cancel
Save