changes discussed in chat on pull 19

This commit is contained in:
Michael Moon 2011-02-02 18:20:08 +11:00
parent fe034d5e35
commit 97f344f0fa
4 changed files with 10 additions and 6 deletions

View File

@ -275,14 +275,16 @@ void process_gcode_command() {
// M7/M106- fan on
case 7:
case 106:
if (NUM_HEATERS > 1)
#if NUM_HEATERS >= 1
heater_set(1, 255);
#endif
break;
// M107- fan off
case 9:
case 107:
if (NUM_HEATERS > 1)
#if NUM_HEATERS >= 1
heater_set(1, 0);
#endif
break;
// M109- set temp and wait

View File

@ -13,7 +13,8 @@
typedef enum
{
#include "config.h"
NUM_HEATERS
NUM_HEATERS,
HEATER_none
} heater_t;
#undef DEFINE_HEATER

2
temp.c
View File

@ -36,7 +36,7 @@ typedef struct {
} temp_sensor_definition_t;
#undef DEFINE_TEMP_SENSOR
#define DEFINE_TEMP_SENSOR(name, type, pin, heater) { (type), (pin), (heater) },
#define DEFINE_TEMP_SENSOR(name, type, pin) { (type), (pin), (HEATER_ ## name) },
static const temp_sensor_definition_t temp_sensors[NUM_TEMP_SENSORS] =
{
#include "config.h"

5
temp.h
View File

@ -13,10 +13,11 @@ we still need to specify which analog pins we use in machine.h for the analog se
*/
#undef DEFINE_TEMP_SENSOR
#define DEFINE_TEMP_SENSOR(name, type, pin, heater) TEMP_SENSOR_##name,
#define DEFINE_TEMP_SENSOR(name, type, pin) TEMP_SENSOR_ ## name,
typedef enum {
#include "config.h"
NUM_TEMP_SENSORS
NUM_TEMP_SENSORS,
TEMP_SENSOR_none
} temp_sensor_t;
#undef DEFINE_TEMP_SENSOR