Handle power_on() for heaters in heater.c.

This removes some instances in gcode_process.c and saves 26 bytes.
This commit is contained in:
Markus Hitter 2012-11-30 03:02:31 +01:00
parent 6f2ec09837
commit 28a366fc48
2 changed files with 5 additions and 7 deletions

View File

@ -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;

View File

@ -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