From 06c546959c2fda7aaa945bce385ad854808aeb19 Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Fri, 31 Aug 2012 13:09:51 +0200 Subject: [PATCH] gcode_process.c: allow controlled fan speed. --- gcode_process.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gcode_process.c b/gcode_process.c index d1c8c62..e944167 100644 --- a/gcode_process.c +++ b/gcode_process.c @@ -506,11 +506,11 @@ void process_gcode_command() { case 7: case 106: - //? --- M106: Fan On --- + //? --- M106: Set Fan Speed --- //? - //? Example: M106 + //? Example: M106 S120 //? - //? Turn on the cooling fan (if any). + //? Control the cooling fan (if any). //? #ifdef ENFORCE_ORDER @@ -518,7 +518,11 @@ void process_gcode_command() { queue_wait(); #endif #ifdef HEATER_FAN - heater_set(HEATER_FAN, 255); + if ( ! next_target.seen_S) + break; + temp_set(HEATER_FAN, next_target.S); + if (next_target.S) + power_on(); #endif break;