diff --git a/gcode_process.c b/gcode_process.c index 03d5482..89a4a14 100644 --- a/gcode_process.c +++ b/gcode_process.c @@ -481,8 +481,6 @@ void process_gcode_command() { if ( ! next_target.seen_P) next_target.P = HEATER_EXTRUDER; temp_set(next_target.P, next_target.S); - if (next_target.S) - power_on(); break; case 105: @@ -533,8 +531,6 @@ void process_gcode_command() { if ( ! next_target.seen_S) break; heater_set(next_target.P, next_target.S); - if (next_target.S) - power_on(); break; case 110: @@ -686,7 +682,6 @@ void process_gcode_command() { next_target.P = HEATER_EXTRUDER; if (next_target.seen_S) { heater_set(next_target.P, next_target.S); - power_on(); } break; @@ -708,8 +703,6 @@ void process_gcode_command() { if ( ! next_target.seen_S) break; temp_set(HEATER_BED, next_target.S); - if (next_target.S) - power_on(); #endif break; diff --git a/heater.c b/heater.c index d8b315d..55bac09 100644 --- a/heater.c +++ b/heater.c @@ -11,6 +11,7 @@ #include "arduino.h" #include "debug.h" #include "temp.h" +#include "pinio.h" #include "crc.h" #ifndef EXTRUDER @@ -436,6 +437,10 @@ void heater_set(heater_t index, uint8_t value) { else *(heaters[index].heater_port) &= ~MASK(heaters[index].heater_pin); } + + // Do this even when the heater is set to + // zero to deal with long cool down phases. + power_on(); } /** \brief turn off all heaters